[ECOS] suspend/resume nesting

sandeep sandeep@codito.com
Wed May 21 10:33:00 GMT 2003

> How would A release the scheduler lock while being
> suspended?
> > <iii> A invokes suspend for itself [sched_lock goes 1->2->1  in this call]
> > [sched_lock = 1]
> > <iv> A releases schedular_lock
> > [sched_lock goes to 0 resulting in call to unlock_inner causing A to be
> > off and B to be brought in]

* you can continue running till you are taken off the processor.*
it is not that -- that the minute your state is marked as SUSPENDED you can't
the unlock() call is made by the thread that is marked as SUSPENDED. Isn't it
executing as a part of this thread's execution?

*if sched_lock was 0 when entering*  "Cyg_Thread::suspend"
 // Set the state
 state |= SUSPENDED;

 // Unlock the scheduler and maybe switch threads
then the unlock call will result in call to unlock_inner and will cause this
thread to be taken off processor.
next time when this thread is brought in, it will be returning to suspend
function after the unlock call.

hope it clears the things for you.

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list