freebsd-dev/lib/libthr
David Xu 02c3c85869 Add signal handler wrapper, the reason to add it becauses there are
some cases we want to improve:
  1) if a thread signal got a signal while in cancellation point,
     it is possible the TDP_WAKEUP may be eaten by signal handler
     if the handler called some interruptibly system calls.
  2) In signal handler, we want to disable cancellation.
  3) When thread holding some low level locks, it is better to
     disable signal, those code need not to worry reentrancy,
     sigprocmask system call is avoided because it is a bit expensive.
The signal handler wrapper works in this way:
  1) libthr installs its signal handler if user code invokes sigaction
     to install its handler, the user handler is recorded in internal
     array.
  2) when a signal is delivered, libthr's signal handler is invoke,
     libthr checks if thread holds some low level lock or is in critical
     region, if it is true, the signal is buffered, and all signals are
     masked, once the thread leaves critical region, correct signal
     mask is restored and buffered signal is processed.
  3) before user signal handler is invoked, cancellation is temporarily
     disabled, after user signal handler is returned, cancellation state
     is restored, and pending cancellation is rescheduled.
2010-09-01 02:18:33 +00:00
..
arch Unify 32-bit and 64-bit PowerPC libthr support. This reduces code 2010-08-24 20:50:08 +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 Add signal handler wrapper, the reason to add it becauses there are 2010-09-01 02:18:33 +00:00
libthr.3 mdoc: order prologue macros consistently by Dd/Dt/Os 2010-04-14 19:08:06 +00:00
Makefile Unify 32-bit and 64-bit PowerPC libthr support. This reduces code 2010-08-24 20:50:08 +00:00
pthread.map Add wrapper for setcontext() and swapcontext(), the wrappers 2010-08-24 09:57:06 +00:00