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]

cheduler unlock function


hi..

//This is only called when the lock is to be decremented to zero and
there
// is the potential for real work to be done. Other cases are handled in
// Cyg_Scheduler::unlock() which is an inline.

sched.cxx shows the sentence above. 
this sentence tells when  ::unlock_inner( ) called.

But I'm confused about what if lock is NOT to be decremented to zero.

for example,
suppose that a thread lock scheduling before doing job for his critcal
region.
sched_lock is going to be 1.
and while the thread doing job for its critical region, INTERRUPT occur
!!
then, KERNEL ISR routine probably will lock scheduling once more.
now, sched_lock is going to be 2.
after KERNEL finish ISR routine, KERNEL will unlock scheduling.
now,  sched_lock is going to be 1.

in this case, lock is not to be decremented to zero. 
But anyway, ::unlock function is called by Kernel_isr_exit_routine.
then ::unlock_inner( ) is called or not ?.


and I don't understand the sentence below,
 "Other cases are handled in Cyg_Scheduler::unlock() which is an inline.
"
Could you tell me about this in more detail.

thanks in advance.

Tony.




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