From af9d0e6976621eee931c80ac4a784885e5a4b5a7 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 11 Jan 2012 14:41:33 -0700 Subject: [PATCH] add missing OS X thread-data synchronization Merge to 5.2.1 --- src/racket/gc2/vm_osx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/racket/gc2/vm_osx.c b/src/racket/gc2/vm_osx.c index 73466e621e..8c63088f88 100644 --- a/src/racket/gc2/vm_osx.c +++ b/src/racket/gc2/vm_osx.c @@ -102,6 +102,7 @@ static void unregister_mach_thread() { int index = thread_self % OSX_THREAD_TABLE_SIZE; OSXThreadData * thread, *prev = NULL; + pthread_mutex_lock(&osxthreadsmutex); thread = osxthreads[index]; while (thread->thread_port_id != thread_self) { prev = thread; @@ -114,6 +115,7 @@ static void unregister_mach_thread() { osxthreads[index] = thread->next; free(thread); } + pthread_mutex_unlock(&osxthreadsmutex); } #endif