From f141720b9efa02365dcdb3d9bdd16acc099c094c Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 6 Apr 2005 14:21:51 +0000 Subject: [PATCH] 2005-04-06 Zoltan Varga * solaris_pthreads.c (GC_pthread_detach): Add locking. svn path=/trunk/mono/; revision=42607 --- libgc/ChangeLog | 2 ++ libgc/solaris_pthreads.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libgc/ChangeLog b/libgc/ChangeLog index 976a9718060..f244a9643e7 100644 --- a/libgc/ChangeLog +++ b/libgc/ChangeLog @@ -1,5 +1,7 @@ 2005-04-06 Zoltan Varga + * solaris_pthreads.c (GC_pthread_detach): Add locking. + * include/gc_pthread_redirects.h (pthread_detach): Override pthread_detach too. * solaris_pthreads.c (GC_pthread_detach): Override pthread_detach too. Fixes diff --git a/libgc/solaris_pthreads.c b/libgc/solaris_pthreads.c index 742433a5dd3..819454b439f 100644 --- a/libgc/solaris_pthreads.c +++ b/libgc/solaris_pthreads.c @@ -65,10 +65,15 @@ int GC_pthread_join(pthread_t wait_for, void **status) int GC_pthread_detach(pthread_t thread) { - GC_thread t = GC_lookup_thread(thread); + GC_thread t; + LOCK(); + t=GC_lookup_thread(thread); + UNLOCK(); if (t) { + LOCK(); t->flags |= DETACHED; + UNLOCK(); return 0; } else -- 2.25.1