libthr: Non-Zero blocked signal nesting level

Mike Makonnen mtm at identd.net
Thu Jul 3 03:04:51 PDT 2003


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 at identd.net | D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9
mtm at FreeBSD.Org| FreeBSD - The Power To Serve
-------------- next part --------------
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);
 }


More information about the freebsd-threads mailing list