This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Doubt on cyg_semaphore_timed_wait


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]