summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread_fork.c
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-11-27 19:42:25 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-11-27 19:42:25 +0000
commitc84c43b4dd4a0b4fd392f5b5171ce683234649e4 (patch)
tree03b0926a8faf866bdf224f37e8957ad44a3d760e /lib/librthread/rthread_fork.c
parenta950c799236bacf77b94096700b5e5489793953c (diff)
Change threxit() to take a pointer to a pid_t to zero out from the
kernel so that librthread can detect when a thread is completely done with its stack without need a kqueue. The dying thread moves itself to a GC list, other threads scan the GC list on pthread_create() and pthread_join() and free the stack and handle once the thread's thread id is zeroed. "get it in" deraadt@, tedu@, cheers by others
Diffstat (limited to 'lib/librthread/rthread_fork.c')
-rw-r--r--lib/librthread/rthread_fork.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/librthread/rthread_fork.c b/lib/librthread/rthread_fork.c
index fe51c5de31e..b5a8afc2dde 100644
--- a/lib/librthread/rthread_fork.c
+++ b/lib/librthread/rthread_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_fork.c,v 1.2 2009/10/21 15:32:01 guenther Exp $ */
+/* $OpenBSD: rthread_fork.c,v 1.3 2009/11/27 19:42:24 guenther Exp $ */
/*
* Copyright (c) 2008 Kurt Miller <kurt@openbsd.org>
@@ -108,9 +108,6 @@ _dofork(int is_vfork)
#endif
if (newid == 0) {
- if (_rthread_open_kqueue())
- _exit(126); /* XXX */
-
/* update this thread's structure */
me->tid = getthrid();
me->donesem.lock = _SPINLOCK_UNLOCKED;