From owner-cvs-src-old@FreeBSD.ORG Wed Oct 22 18:16:39 2008 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19C111065679 for ; Wed, 22 Oct 2008 18:16:39 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 06A878FC24 for ; Wed, 22 Oct 2008 18:16:39 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MIGc0s058329 for ; Wed, 22 Oct 2008 18:16:38 GMT (envelope-from alfred@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9MIGcNV058326 for cvs-src-old@freebsd.org; Wed, 22 Oct 2008 18:16:38 GMT (envelope-from alfred@repoman.freebsd.org) Message-Id: <200810221816.m9MIGcNV058326@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to alfred@repoman.freebsd.org using -f From: Alfred Perlstein Date: Wed, 22 Oct 2008 18:07:37 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_6 Subject: cvs commit: src/lib/libthr/thread thr_cond.c thr_private.h src/sys/kern kern_umtx.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:16:39 -0000 alfred 2008-10-22 18:07:37 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) lib/libthr/thread thr_cond.c thr_private.h sys/kern kern_umtx.c Log: SVN rev 184172 on 2008-10-22 18:07:37Z by alfred Close races in the pthread_condvar implementation in 6.x, note that 7.x and beyond have very different implementations and these fixes do not apply. In the kernel: Move the flag UQF_UMTXQ from the thread's td_flags where it was unlocked to the umtx_q struct where it now has locking. Nuke the UMTX_DYNAMIC_SHARED define while here, it's unused and complex. Refactor do_wait so that if we get a signal or timeout AND woken up, we forward the wakeup to any other waiters pending to avoid a missed wakeup. In userland: Bring over some fixes from DragonFlyBSD for the userland part of pthread_condvars, basically relax the consistency on the number of waiters and signals pending because it was both too strict and incorrect causing lost wakeups. Reviewed by: davidxu Approved by: re Revision Changes Path 1.16.2.1 +36 -35 src/lib/libthr/thread/thr_cond.c 1.47.2.4 +1 -1 src/lib/libthr/thread/thr_private.h 1.33.2.5 +34 -115 src/sys/kern/kern_umtx.c