[w32file] Move MonoIO.Find{First,Next,Close} to managed
[mono.git] / libgc / solaris_pthreads.c
index 742433a5dd3681a657cefed2ba82087f2b2d8275..b1c70feebc594fbec0cb979f52ccf402e4d9f64d 100644 (file)
  * Modified by Peter C. for Solaris Posix Threads.
  */
 
-# if defined(GC_SOLARIS_PTHREADS)
 # include "private/gc_priv.h"
+
+# if defined(GC_SOLARIS_PTHREADS)
+
+/* Avoid  #error"Cannot use procfs in the large file compilation environment" */
+#if defined(_ILP32) && (_FILE_OFFSET_BITS != 32)
+#undef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 32
+#endif
+
 # include <pthread.h>
 # include <thread.h>
 # include <signal.h>
@@ -65,10 +73,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