aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-08-17 16:19:56 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-08-17 16:19:56 -0700
commit200de748b91d7638a2c434584abcb3840704494b (patch)
treed8b4473e1e707d67c487f89e49667a65505bd245 /libc/bionic/pthread.c
parent1771a33d11a24f1c47b1ef75e3726c5d9e751f5b (diff)
parent2932f048327965731c7e1ab9f2968a2ddb1854f5 (diff)
downloadandroid_bionic-200de748b91d7638a2c434584abcb3840704494b.tar.gz
android_bionic-200de748b91d7638a2c434584abcb3840704494b.tar.bz2
android_bionic-200de748b91d7638a2c434584abcb3840704494b.zip
Merge "Fix race condition in pthread_create()"
Diffstat (limited to 'libc/bionic/pthread.c')
-rw-r--r--libc/bionic/pthread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index 2e2c09d01..40a09ba6e 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -364,10 +364,10 @@ int pthread_create(pthread_t *thread_out, pthread_attr_t const * attr,
_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;
}