Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jul 2003 06:04:48 -0400
From:      Mike Makonnen <mtm@identd.net>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        threads@freebsd.org
Subject:   Re: libthr: Non-Zero blocked signal nesting level
Message-ID:  <20030703100448.GF1593@kokeb.ambesa.net>
In-Reply-To: <20030703085258.GA19450@dhcp01.pn.xcllnt.net>
References:  <20030703085258.GA19450@dhcp01.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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+/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030703100448.GF1593>