This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Condition Variables recap
- To: "Trenton D. Adams" <tadams at extremeeng dot com>
- Subject: Re: [ECOS] Condition Variables recap
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Tue, 24 Jul 2001 21:17:10 +0100
- Cc: 'eCos mailing list' <ecos-discuss at sources dot redhat dot com>
- Organization: Red Hat UK Ltd.
- References: <003901c1147b$3e2e28f0$090110ac@TRENT>
"Trenton D. Adams" wrote:
>
> cyg_mutex_trylock () is not documented in my documentation. I assume
> I'm not required to call that before the actual locking?
Curiously that is true. I'll make a note to fix that.
Gary Thomas wrote:
> The difference between cyg_cond_signal() and cyg_cond_broadcast() is
> that with the former at most one thread waiting on the condition
> variable will be awakened.
You mean "at least", not "at most". cyg_cond_signal() may wake up more than
one thread (which is the norm for CV implementations, not just eCos).
That's why you should always loop and retest the condition when doing a
cyg_cond_wait().
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions http://www.redhat-techworld.com/