From owner-cvs-all Wed Jun 27 4:41:19 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 31F7A37B405; Wed, 27 Jun 2001 04:41:16 -0700 (PDT) (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5RBfGm89143; Wed, 27 Jun 2001 04:41:16 -0700 (PDT) (envelope-from jasone) Message-Id: <200106271141.f5RBfGm89143@freefall.freebsd.org> From: Jason Evans Date: Wed, 27 Jun 2001 04:41:16 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc_r/uthread pthread_private.h uthread_find_thread.c uthread_join.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG jasone 2001/06/27 04:41:16 PDT Modified files: lib/libc_r/uthread pthread_private.h uthread_find_thread.c uthread_join.c Log: Fix a race condition in pthread_join(). All of the following must occur atomically: 1) Search _thread_list for the thread to join. 2) Search _dead_list for the thread to join. 3) Set the running thread as the joiner. While we're at it, fix a race in the case where multiple threads try to join on the same thread. POSIX says that the behavior of multiple joiners is undefined, but the fix is cheap as a result of the other fix. Revision Changes Path 1.58 +1 -2 src/lib/libc_r/uthread/pthread_private.h 1.7 +1 -33 src/lib/libc_r/uthread/uthread_find_thread.c 1.18 +54 -16 src/lib/libc_r/uthread/uthread_join.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message