diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2009-11-27 19:42:25 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2009-11-27 19:42:25 +0000 |
commit | c84c43b4dd4a0b4fd392f5b5171ce683234649e4 (patch) | |
tree | 03b0926a8faf866bdf224f37e8957ad44a3d760e /lib/librthread/rthread_fork.c | |
parent | a950c799236bacf77b94096700b5e5489793953c (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.c | 5 |
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; |