From owner-freebsd-threads@FreeBSD.ORG Thu Jul 3 03:04:51 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53B5137B401 for ; Thu, 3 Jul 2003 03:04:51 -0700 (PDT) Received: from pool-151-200-10-97.res.east.verizon.net (pool-138-88-156-213.esr.east.verizon.net [138.88.156.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3348A43FBF for ; Thu, 3 Jul 2003 03:04:50 -0700 (PDT) (envelope-from mtm@identd.net) Received: from kokeb.ambesa.net (localhost [IPv6:::1]) id h63A4nck006901; Thu, 3 Jul 2003 06:04:49 -0400 (EDT) (envelope-from mtm@identd.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.9/8.12.6/Submit) id h63A4n8e006900; Thu, 3 Jul 2003 06:04:49 -0400 (EDT) (envelope-from mtm@identd.net) Date: Thu, 3 Jul 2003 06:04:48 -0400 From: Mike Makonnen To: Marcel Moolenaar Message-ID: <20030703100448.GF1593@kokeb.ambesa.net> References: <20030703085258.GA19450@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ctP54qlpMx3WjD+/" Content-Disposition: inline In-Reply-To: <20030703085258.GA19450@dhcp01.pn.xcllnt.net> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD/5.1-CURRENT (i386) cc: threads@freebsd.org Subject: Re: libthr: Non-Zero blocked signal nesting level X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2003 10:04:51 -0000 --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 03, 2003 at 01:52:58AM -0700, Marcel Moolenaar wrote: > Mike, > > Is your signal patch related to: > No, but I think the attached patch will fix the problem you're seeing. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 mtm@FreeBSD.Org| FreeBSD - The Power To Serve --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="trylock.diff" Index: lib/libthr/thread/thr_mutex.c =================================================================== RCS file: /home/ncvs/src/lib/libthr/thread/thr_mutex.c,v retrieving revision 1.15 diff -u -r1.15 thr_mutex.c --- lib/libthr/thread/thr_mutex.c 2 Jul 2003 02:05:23 -0000 1.15 +++ lib/libthr/thread/thr_mutex.c 3 Jul 2003 09:59:11 -0000 @@ -309,6 +309,8 @@ if (mutex == NULL) ret = EINVAL; + _thread_sigblock(); + /* * If the mutex is statically initialized, perform the dynamic * initialization marking the mutex private (delete safe): @@ -316,6 +318,9 @@ else if ((*mutex != PTHREAD_MUTEX_INITIALIZER) || (ret = mutex_init(mutex, 1)) == 0) ret = mutex_lock_common(mutex, 1); + + if (ret != 0) + _thread_sigunblock(); return (ret); } --ctP54qlpMx3WjD+/--