Date: Fri, 23 May 2003 18:02:16 -0700 (PDT) From: Mike Makonnen <mtm@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libthr/thread thr_cond.c Message-ID: <200305240102.h4O12GU1006599@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305240102.h4O12GU1006599>
