This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_thread_resume
- To: Paleologos Spanos <paleolog at ee dot ucla dot edu>
- Subject: Re: [ECOS] cyg_thread_resume
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 18 Jan 2001 00:23:44 +0000
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <Pine.GSO.4.10.10101171455270.13391-100000@sierra.ee.ucla.edu>
Paleologos Spanos wrote:
>
> Hi,I have a problem using the cyg_thread_resume function.
> I have configured the scheduler to have the bitmap scheduler.I tried to
> modify the scheduler so as to test if it is possible to resume an exited
> thread.However,the thread's state didn't change.
> What I did was to add after the if loop in line :161 in the sched.cxx
> file the below code :
> Cyg_Thread *current = Cyg_Scheduler::get_current_thread();
> cyg_thread_kill ((cyg_handle_t) current);
> cyg_thread_resume((cyg_handle_t) current);
>
> I have 2 threads on the application level and I would expect that the
> output should be
>
> execution of thread1
> (resume thread1)
> execution of thread1
> (resume thread1)
> execution of thread1
> ....
> ....
>
> I tested these commands without the cyg_thread_resume and the thread was
> stopped(because of the cyg_thread_kill i suppose).
> However adding the command ofcyg_thread_resume does not restart the
> thread.Why?
>
> What am I doing wrong?
Uh... you just killed yourself so you aren't running any more, so how can
you then resume? Another thread has to resume you.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine