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]

a confusion regarding role of schedlock


hi list,

Out of interest to know about an RTOS, I am browsing
through the eCos source code (is there any other GPL
RTOS available, source code of which i can download
and browse??)

Please don't mind if my doubts sound stupid.

I came across this piece of code in cnt_sem.cxx, that
confused me a bit.

cyg_bool Cyg_Counting_Semaphore::wait()
{
-- ..... --     
     // Prevent preemption
     Cyg_Scheduler::lock();
-- ..... -- 
         // Allow other threads to run
         Cyg_Scheduler::reschedule();
-- ..... --
     // Unlock the scheduler
     Cyg_Scheduler::unlock();
-- ..... --
}

In the beginning we take schedlock to prevent
preemption and then we ourselves allow other threads
to run while schedlock is still non-zero? 

may be similar kind of situations are in more places?

brij


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

-- 
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]