pthread: assign handle argument before resuming the created thread
It's not specified by POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_create.html "There is no requirement on the implementation that the ID of the created thread be available before the newly created thread starts executing." However I've run into it with MPD which assumed this, probably because of Linux: https://github.com/MusicPlayerDaemon/MPD/issues/188 It doesn't hurt anyway.
This commit is contained in:
parent
da30fdf96a
commit
4069b740e5
@ -160,8 +160,8 @@ pthread_create(pthread_t* _thread, const pthread_attr_t* attr,
|
||||
}
|
||||
|
||||
__set_stack_protection();
|
||||
resume_thread(thread->id);
|
||||
*_thread = thread;
|
||||
resume_thread(thread->id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user