freebsd-dev/lib/libthr
Konstantin Belousov 066d836b02 Current pselect(3) is implemented in usermode and thus vulnerable to
well-known race condition, which elimination was the reason for the
function appearance in first place. If sigmask supplied as argument to
pselect() enables a signal, the signal might be delivered before thread
called select(2), causing lost wakeup. Reimplement pselect() in kernel,
making change of sigmask and sleep atomic.

Since signal shall be delivered to the usermode, but sigmask restored,
set TDP_OLDMASK and save old mask in td_oldsigmask. The TDP_OLDMASK
should be cleared by ast() in case signal was not gelivered during
syscall execution.

Reviewed by:	davidxu
Tested by:	pho
MFC after:	1 month
2009-10-27 10:55:34 +00:00
..
arch Implement _umtx_op_err() for ia64. 2009-10-24 20:07:17 +00:00
support Use thr_new syscall to create a new thread, obscure context operations 2005-04-23 02:48:59 +00:00
sys __error could be called too early before libthr is initialized, test 2006-07-12 03:44:05 +00:00
thread Current pselect(3) is implemented in usermode and thus vulnerable to 2009-10-27 10:55:34 +00:00
libthr.3 - Stop calling libthr alternative as it's now the default 2007-10-22 10:13:38 +00:00
Makefile Turn on nodelete linker flag because libthr can not be unloaded safely, 2009-03-31 02:50:18 +00:00
pthread.map Make openat(2) a cancellation point. 2009-10-11 20:19:45 +00:00