cvs commit: src/lib/libthr/thread thr_cond.c
Mike Makonnen
mtm at FreeBSD.org
Fri May 23 18:02:17 PDT 2003
mtm 2003/05/23 18:02:16 PDT
FreeBSD src repository
Modified files:
lib/libthr/thread thr_cond.c
Log:
Lock the cond queue (condition variables):
Access to the thread's flags and state is protected by
_thread_critical_enter/exit(). When a thread is signaled with a condition
its state must be protected by locking it and disabling
signals before it is taken of the waiters' queue.
Move the implementation of pthread_cond_signal() and pthread_cond_broadcast()
into one function, cond_signal(). Its behaviour is determined by the
last argument, int broadcast. If this is set to 1 it will remove all
waiters, otherwise it will wake up only the first waiter thread.
Remove an extraneous call to pthread_testcancel().
Approved by: re/blanket libthr
Revision Changes Path
1.6 +43 -70 src/lib/libthr/thread/thr_cond.c
More information about the cvs-all
mailing list