* 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>
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