From owner-cvs-src@FreeBSD.ORG Wed Oct 13 11:42:20 2004 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 BF2A916A4CE; Wed, 13 Oct 2004 11:42:20 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B2E3243D5D; Wed, 13 Oct 2004 11:42:20 +0000 (GMT) (envelope-from mtm@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9DBgKcA099194; Wed, 13 Oct 2004 11:42:20 GMT (envelope-from mtm@repoman.freebsd.org) Received: (from mtm@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9DBgKUb099193; Wed, 13 Oct 2004 11:42:20 GMT (envelope-from mtm) Message-Id: <200410131142.i9DBgKUb099193@repoman.freebsd.org> From: Mike Makonnen Date: Wed, 13 Oct 2004 11:42:20 +0000 (UTC) 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_exit.c thr_join.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: Wed, 13 Oct 2004 11:42:21 -0000 mtm 2004-10-13 11:42:20 UTC FreeBSD src repository Modified files: lib/libthr/thread thr_exit.c thr_join.c Log: 1. Now that it's a thread's state is changed from within the kernel, where no userland locks are heald, the dead thread lock can no longer protect access to it. Therefore, instead of using an if (!dead)...else clause after walking the active threads list test the thread pointer before deciding not to walk the dead threads list. If the thread pointer is null it means it was not found in the active threads list and the dead threads list should be checked. 2. Do not free the stack of a thread that is not marked dead. This is the 2nd and final part of eliminating the race to free a thread's stack. MFC after: 3 days Revision Changes Path 1.16 +2 -1 src/lib/libthr/thread/thr_exit.c 1.15 +8 -3 src/lib/libthr/thread/thr_join.c