This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: waiting for more than one cond in pThread question
- From: Keith Willis <keith at bytebrothers dot co dot uk>
- To: pthreads-win32 at sourceware dot cygnus dot com
- Cc: nir dot nizry at bluesoft-inc dot com
- Date: Tue, 02 Apr 2002 15:46:27 +0100
- Subject: Re: waiting for more than one cond in pThread question
- Organization: Bytebrothers Software (UK)
- References: <JEEHINPAHDLKGLNOLIOCAEDICAAA.email@example.com>
On Tue, 2 Apr 2002 13:27:25 +0200, "Nir Nizry"
>I probably wasn't much understood. What I'm trying is wait for one OR more.
>I want to "be release" when either one OR more of the conds/events are set
>and I have to know which one was set.
OK, how about you associate one mutex/condvar with the _set_ of
predicate conditions, and do something like:
while (predicate_one == FALSE && predicate_two == FALSE)
if (predicate_one == TRUE)
else if (predicate_two == TRUE)
1. I'm sure the great and the good will have something to say about
the wisdom of doing this!
PGP key ID 0xEB7180EC
Available from http://www.keyserver.net