summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_gc.c
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-05-26 00:37:07 +0000
committermtm <mtm@FreeBSD.org>2003-05-26 00:37:07 +0000
commit23f766944414893832e8a3d10afbceded194916f (patch)
tree4913d71c40094f5da6427b152c90be36f35dfdd6 /lib/libthr/thread/thr_gc.c
parent3440accd67bef89b04b9c16c578fd05c6de445b3 (diff)
downloadFreeBSD-src-23f766944414893832e8a3d10afbceded194916f.zip
FreeBSD-src-23f766944414893832e8a3d10afbceded194916f.tar.gz
Decouple the thread stack [de]allocating functions from the 'dead threads list'
lock. It's not really necessary and we don't need the added complexity or potential for deadlocks. Approved by: re/blanket libthr
Diffstat (limited to 'lib/libthr/thread/thr_gc.c')
-rw-r--r--lib/libthr/thread/thr_gc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_gc.c b/lib/libthr/thread/thr_gc.c
index d491bff..9e26314 100644
--- a/lib/libthr/thread/thr_gc.c
+++ b/lib/libthr/thread/thr_gc.c
@@ -113,6 +113,7 @@ _thread_gc(pthread_addr_t arg)
* the caller to pthread_create() and has not
* been destroyed yet:
*/
+ STACK_LOCK;
if (pthread->attr.stackaddr_attr == NULL &&
pthread->stack != NULL) {
_thread_stack_free(pthread->stack,
@@ -120,6 +121,7 @@ _thread_gc(pthread_addr_t arg)
pthread->attr.guardsize_attr);
pthread->stack = NULL;
}
+ STACK_UNLOCK;
/*
* If the thread has not been detached, leave
OpenPOWER on IntegriCloud