This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
a confusion regarding role of schedlock
- From: Brij Bihari Pandey <fuzzhead012 at yahoo dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Fri, 13 Sep 2002 00:01:28 -0700 (PDT)
- Subject: [ECOS] 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