improve design of thread-start with explicit scheduling attributes
authorRich Felker <dalias@aerifal.cx>
Wed, 9 May 2018 04:14:13 +0000 (00:14 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 9 May 2018 04:36:09 +0000 (00:36 -0400)
commitb8742f32602add243ee2ce74d804015463726899
tree5a511e7d917a38bab0c2bb3aaa7457e6dd85e797
parent1db9a35569d51155eb7f2ccf26d420ae4e42e416
improve design of thread-start with explicit scheduling attributes

eliminate the awkward startlock mechanism and corresponding fields of
the pthread structure that were only used at startup.

instead of having pthread_create perform the scheduling operations and
having the new thread wait for them to be completed, start the new
thread with a wrapper start function that performs its own scheduling,
sending the result code back via a futex. this way the new thread can
use storage from the calling thread's stack rather than permanent
fields in the pthread structure.
src/internal/pthread_impl.h
src/thread/pthread_create.c