2005-04-06 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Wed, 6 Apr 2005 14:04:22 +0000 (14:04 -0000)
committerZoltan Varga <vargaz@gmail.com>
Wed, 6 Apr 2005 14:04:22 +0000 (14:04 -0000)
* 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

libgc/ChangeLog
libgc/include/gc_pthread_redirects.h
libgc/solaris_pthreads.c

index f6ed8ef41121ba9194d578dcb5e976759274a4a7..976a9718060690d383603e448617139aa272f829 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-06  Zoltan Varga  <vargaz@freemail.hu>
+
+       * 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  <vargaz@freemail.hu>
 
        * os_dep.c: Add ability to fall back to mmap-ing memory when sbrk
index 842518cfcc48c2a0657b1cc6581994abf5cd8a44..5cc8d4734021095d7862e6d8f4fc56a3f16e903c 100644 (file)
                                 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)
index bae77193593f5e963ccd7b1531f3bb774840a802..742433a5dd3681a657cefed2ba82087f2b2d8275 100644 (file)
@@ -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,