This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Doubt on cyg_semaphore_timed_wait
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: Reji P Rajesh <rejip at cdotb dot ernet dot in>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 09 Jun 2003 16:01:24 +0100
- Subject: Re: [ECOS] Doubt on cyg_semaphore_timed_wait
- References: <Pine.OSF.4.21.0306091645200.20513-100000@ws9.cdotb.ernet.in>
Reji P Rajesh <rejip@cdotb.ernet.in> writes:
> Hi Nick,
> I have traced code on cyg_semphore_timed_wait system call.
> My doubt is on the file cnt_sem.cxx, and line number 147.
> Here the currently running thread calls
> set_timer(timeout,Cyg_Thread::TIMEOUT), which will cause currently
> running thread be
> taken out from multi level run queue and state of thread is changed to
> (RUNNING + SLEEPING).
The state is just SLEEPING.
> My doubt is, how this thread will be brought back
> into multilevel run queue, other than the timeout?.More precisely,
> when/how this thread's wake_reason be set to NONE.
>
The thread is woken up in the usual way by Cyg_Counting_Semaphore::post().
But here the wake_reason will be set to DONE not NONE. It is only set
to NONE in set_timer().
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss