commit | 200de748b91d7638a2c434584abcb3840704494b | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Fri Aug 17 16:19:56 2012 -0700 |
committer | android code review <noreply-gerritcodereview@google.com> | Fri Aug 17 16:19:56 2012 -0700 |
tree | d8b4473e1e707d67c487f89e49667a65505bd245 | |
parent | 1771a33d11a24f1c47b1ef75e3726c5d9e751f5b [diff] | |
parent | 2932f048327965731c7e1ab9f2968a2ddb1854f5 [diff] |
Merge "Fix race condition in pthread_create()"
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c index 2e2c09d..40a09ba 100644 --- a/libc/bionic/pthread.c +++ b/libc/bionic/pthread.c
@@ -364,10 +364,10 @@ _thread_created_hook(tid); pthread_mutex_unlock(&gDebuggerNotificationLock); - // Let the thread run. + // Publish the pthread_t and let the thread run. + *thread_out = (pthread_t) thread; pthread_mutex_unlock(start_mutex); - *thread_out = (pthread_t) thread; return 0; }