add missing OS X thread-data synchronization

Merge to 5.2.1
This commit is contained in:
Matthew Flatt 2012-01-11 14:41:33 -07:00
parent 0134b8753d
commit af9d0e6976

View File

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