From owner-cvs-src@FreeBSD.ORG Fri May 23 18:02:17 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A81837B401; Fri, 23 May 2003 18:02:17 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F252143F75; Fri, 23 May 2003 18:02:16 -0700 (PDT) (envelope-from mtm@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h4O12G0U006600; Fri, 23 May 2003 18:02:16 -0700 (PDT) (envelope-from mtm@repoman.freebsd.org) Received: (from mtm@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h4O12GU1006599; Fri, 23 May 2003 18:02:16 -0700 (PDT) Message-Id: <200305240102.h4O12GU1006599@repoman.freebsd.org> From: Mike Makonnen Date: Fri, 23 May 2003 18:02:16 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libthr/thread thr_cond.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2003 01:02:17 -0000 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