From owner-cvs-src@FreeBSD.ORG Fri May 23 19:29:27 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 C214337B401; Fri, 23 May 2003 19:29:27 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 072F343F85; Fri, 23 May 2003 19:29:27 -0700 (PDT) (envelope-from deischen@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 h4O2TQ0U012535; Fri, 23 May 2003 19:29:26 -0700 (PDT) (envelope-from deischen@repoman.freebsd.org) Received: (from deischen@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h4O2TQmW012534; Fri, 23 May 2003 19:29:26 -0700 (PDT) Message-Id: <200305240229.h4O2TQmW012534@repoman.freebsd.org> From: Daniel Eischen Date: Fri, 23 May 2003 19:29:26 -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/libpthread/sys lock.c lock.h src/lib/libpthread/thread thr_cancel.c thr_concurrency.c thr_cond.c thr_create.c thr_detach.c thr_find_thread.c thr_join.c thr_kern.c thr_nanosleep.c thr_sig.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 02:29:28 -0000 deischen 2003/05/23 19:29:26 PDT FreeBSD src repository Modified files: lib/libpthread/sys lock.c lock.h lib/libpthread/thread thr_cancel.c thr_concurrency.c thr_cond.c thr_create.c thr_detach.c thr_find_thread.c thr_join.c thr_kern.c thr_nanosleep.c thr_sig.c Log: Change low-level locking a bit so that we can tell if a lock is being waitied on. Fix a races in join and cancellation. When trying to wait on a CV and the library is not yet threaded, make it threaded so that waiting actually works. When trying to nanosleep() and we're not threaded, just call the system call nanosleep instead of adding the thread to the wait queue. Clean up adding/removing new threads to the "all threads queue", assigning them unique ids, and tracking how many active threads there are. Do it all when the thread is added to the scheduling queue instead of making pthread_create() know how to do it. Fix a race where a thread could be marked for signal delivery but it could be exited before we actually add the signal to it. Other minor cleanups and bug fixes. Submitted by: davidxu Approved by: re@ (blanket for libpthread) Revision Changes Path 1.5 +33 -21 src/lib/libpthread/sys/lock.c 1.5 +1 -2 src/lib/libpthread/sys/lock.h 1.21 +20 -0 src/lib/libpthread/thread/thr_cancel.c 1.3 +1 -0 src/lib/libpthread/thread/thr_concurrency.c 1.42 +6 -0 src/lib/libpthread/thread/thr_cond.c 1.45 +9 -24 src/lib/libpthread/thread/thr_create.c 1.22 +4 -4 src/lib/libpthread/thread/thr_detach.c 1.12 +12 -6 src/lib/libpthread/thread/thr_find_thread.c 1.26 +11 -0 src/lib/libpthread/thread/thr_join.c 1.67 +175 -92 src/lib/libpthread/thread/thr_kern.c 1.21 +3 -0 src/lib/libpthread/thread/thr_nanosleep.c 1.51 +22 -8 src/lib/libpthread/thread/thr_sig.c