This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
cyg_cond_signal() without cyg_cond_wait ()
- To: "eCos Discussion" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] cyg_cond_signal() without cyg_cond_wait ()
- From: "Trenton D. Adams" <tadams at theone dot dnsalias dot com>
- Date: Wed, 29 Aug 2001 14:31:48 -0600
I've been looking through the kernel sources for answers now that I
understand a little more how eCos is laid out.
>From what I've seen, it would appear that if I call cyg_cond_signal ()
while there isn't a cyg_cond_wait () in progress, nothing will happen at
all. For example, I thought that MAYBE the condition variable would be
signaled at a later time when cyg_cond_wait () was finally called. It
looks like cyg_cond_wait () queues the waiting threads and
cyg_cond_signal dequeues them. But, it appears that cyg_cond_signals
are not queued, correct?
Based on that information, I should leave the condition variable's mutex
locked until such time that I can loop again to call cyg_cond_wait (),
correct? Should I be locking the scheduler at the end of the loop until
the next loop has started? If I don't, it's theoretically possible that
a cyg_cond_signal () could occur before I get back to my cyg_cond_wait
(), correct?
Trenton D. Adams
Extreme Engineering
#17, 6025 - 12 St. SE
Calgary, Alberta, Canada
T2H 2K1
Phone: 403 640 9494 ext-208
Fax: 403 640 9599
http://www.extremeeng.com