summaryrefslogtreecommitdiff
path: root/pthread
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-09-21 23:40:27 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-09-21 23:40:27 +0200
commit5396c1d55933adce68891e000d10ecb8ed168caa (patch)
treebc2ab616d69848070111cb866a9288c2d226f6d4 /pthread
parent1b99b0ffaf09cd7500c9390704ed56be47882d70 (diff)
parentb9eb71a78f15f5f889114fb1f5393be74789039d (diff)
Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/libpthread
Diffstat (limited to 'pthread')
-rw-r--r--pthread/pt-create.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index 9ce0be8..a88c498 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -195,16 +195,16 @@ __pthread_create_internal (struct __pthread **thread,
/* At this point it is possible to guess our pthread ID. We have to
make sure that all functions taking a pthread_t argument can
- handle the fact that this thread isn't really running yet. */
+ handle the fact that this thread isn't really running yet. Since
+ the new thread might be passed its ID through pthread_create (to
+ avoid calling pthread_self), read it before starting the thread. */
+ *thread = pthread;
/* Schedule the new thread. */
err = __pthread_thread_start (pthread);
if (err)
goto failed_starting;
- /* At this point the new thread is up and running. */
-
- *thread = pthread;
return 0;