summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-02-01 08:24:43 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-02-01 08:24:43 +0000
commit08f75dd11028dbc189470475602e24924ff26307 (patch)
tree72c71bda920016243ddfd56701e8281b78effbe8
parent491e3a8354e211e12d542767803888faa2653ff1 (diff)
don't handle signals in the gc thread
-rw-r--r--lib/libc_r/uthread/uthread_gc.c8
-rw-r--r--lib/libpthread/uthread/uthread_gc.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/libc_r/uthread/uthread_gc.c b/lib/libc_r/uthread/uthread_gc.c
index 33cddebe45a..56fbbb79e12 100644
--- a/lib/libc_r/uthread/uthread_gc.c
+++ b/lib/libc_r/uthread/uthread_gc.c
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* $FreeBSD: uthread_gc.c,v 1.2 1998/09/30 19:17:51 dt Exp $
- * $OpenBSD: uthread_gc.c,v 1.3 1998/12/23 22:49:46 d Exp $
+ * $OpenBSD: uthread_gc.c,v 1.4 1999/02/01 08:24:42 d Exp $
*
* Garbage collector thread. Frees memory allocated for dead threads.
*
@@ -58,6 +58,12 @@ _thread_gc(pthread_addr_t arg)
pthread_t pthread_prv;
struct timespec abstime;
void *p_stack;
+ sigset_t ss;
+
+ /* Don't handle signals in this thread */
+ sigfillset(&ss);
+ if (ret = pthread_sigmask(SIG_BLOCK, &ss, NULL))
+ PANIC("Can't block signals in GC thread");
/* Set a debug flag based on an environment variable. */
f_debug = (getenv("LIBC_R_DEBUG") != NULL);
diff --git a/lib/libpthread/uthread/uthread_gc.c b/lib/libpthread/uthread/uthread_gc.c
index 33cddebe45a..56fbbb79e12 100644
--- a/lib/libpthread/uthread/uthread_gc.c
+++ b/lib/libpthread/uthread/uthread_gc.c
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* $FreeBSD: uthread_gc.c,v 1.2 1998/09/30 19:17:51 dt Exp $
- * $OpenBSD: uthread_gc.c,v 1.3 1998/12/23 22:49:46 d Exp $
+ * $OpenBSD: uthread_gc.c,v 1.4 1999/02/01 08:24:42 d Exp $
*
* Garbage collector thread. Frees memory allocated for dead threads.
*
@@ -58,6 +58,12 @@ _thread_gc(pthread_addr_t arg)
pthread_t pthread_prv;
struct timespec abstime;
void *p_stack;
+ sigset_t ss;
+
+ /* Don't handle signals in this thread */
+ sigfillset(&ss);
+ if (ret = pthread_sigmask(SIG_BLOCK, &ss, NULL))
+ PANIC("Can't block signals in GC thread");
/* Set a debug flag based on an environment variable. */
f_debug = (getenv("LIBC_R_DEBUG") != NULL);