From: Zoltan Varga Date: Wed, 6 Apr 2005 14:04:22 +0000 (+0000) Subject: 2005-04-06 Zoltan Varga X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=792ced9c4f49324b2a8f0d0e3070b5b88a8fe98f;p=gc 2005-04-06 Zoltan Varga * include/gc_pthread_redirects.h (pthread_detach): Override pthread_detach too. * solaris_pthreads.c (GC_pthread_detach): Override pthread_detach too. Fixes #74223. svn path=/trunk/mono/; revision=42606 --- diff --git a/ChangeLog b/ChangeLog index 863d9db0..2de5f519 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-06 Zoltan Varga + + * include/gc_pthread_redirects.h (pthread_detach): Override pthread_detach too. + + * solaris_pthreads.c (GC_pthread_detach): Override pthread_detach too. Fixes + #74223. + 2005-03-29 Zoltan Varga * os_dep.c: Add ability to fall back to mmap-ing memory when sbrk diff --git a/include/gc_pthread_redirects.h b/include/gc_pthread_redirects.h index 842518cf..5cc8d473 100644 --- a/include/gc_pthread_redirects.h +++ b/include/gc_pthread_redirects.h @@ -35,8 +35,10 @@ const pthread_attr_t *attr, void * (*thread_execp)(void *), void *arg); extern int GC_pthread_join(pthread_t wait_for, void **status); + extern int GC_pthread_detach(pthread_t thread); # define pthread_join GC_pthread_join # define pthread_create GC_pthread_create +# define pthread_detach GC_pthread_detach #endif #if defined(GC_SOLARIS_PTHREADS) || defined(GC_SOLARIS_THREADS) diff --git a/solaris_pthreads.c b/solaris_pthreads.c index bae77193..742433a5 100644 --- a/solaris_pthreads.c +++ b/solaris_pthreads.c @@ -63,6 +63,17 @@ int GC_pthread_join(pthread_t wait_for, void **status) return GC_thr_join((thread_t)wait_for, NULL, status); } +int GC_pthread_detach(pthread_t thread) +{ + GC_thread t = GC_lookup_thread(thread); + + if (t) { + t->flags |= DETACHED; + return 0; + } + else + return pthread_detach(thread); +} int GC_pthread_create(pthread_t *new_thread,