diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-09-21 23:40:27 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-09-21 23:40:27 +0200 |
commit | 5396c1d55933adce68891e000d10ecb8ed168caa (patch) | |
tree | bc2ab616d69848070111cb866a9288c2d226f6d4 /pthread | |
parent | 1b99b0ffaf09cd7500c9390704ed56be47882d70 (diff) | |
parent | b9eb71a78f15f5f889114fb1f5393be74789039d (diff) |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/libpthread
Diffstat (limited to 'pthread')
-rw-r--r-- | pthread/pt-create.c | 8 |
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; |