108 Commits

Author SHA1 Message Date
Rich Felker
98e02144da use rt_sigprocmask, not legacy sigprocmask, syscall in pthread exit code 2011-02-19 15:21:05 -05:00
Rich Felker
19eb13b9a4 race condition fix: block all signals before decrementing thread count
the existence of a (kernelspace) thread must never have observable
effects after the thread count is decremented. if signals are not
blocked, it could end up handling the signal for rsyscall and
contributing towards the count of threads which have changed ids,
causing a thread to be missed. this could lead to one thread retaining
unwanted privilege level.

this change may also address other subtle race conditions in
application code that uses signals.
2011-02-19 11:04:36 -05:00
Rich Felker
fb11b6b85e make pthread_exit run dtors for last thread, wait to decrement thread count 2011-02-19 10:38:57 -05:00
Rich Felker
e882756311 reorganize pthread data structures and move the definitions to alltypes.h
this allows sys/types.h to provide the pthread types, as required by
POSIX. this design also facilitates forcing ABI-compatible sizes in
the arch-specific alltypes.h, while eliminating the need for
developers changing the internals of the pthread types to poke around
with arch-specific headers they may not be able to test.
2011-02-17 17:16:20 -05:00
Rich Felker
0b2006c8fe begin unifying clone/thread management interface in preparation for porting 2011-02-15 03:24:58 -05:00
Rich Felker
59666802fb make pthread_create return EAGAIN on resource failure, as required by POSIX 2011-02-15 02:20:21 -05:00
Rich Felker
1a9a2ff7b0 reorganize thread exit code, make pthread_exit call cancellation handlers (pt2) 2011-02-13 19:58:30 -05:00
Rich Felker
0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00