freebsd-dev/lib/libpthread/thread
David Xu a772047bc6 o Use a daemon thread to monitor signal events in kernel, if pending
signals were changed in kernel, it will retrieve the pending set and
  try to find a thread to dispatch the signal. The dispatching process
  can be rolled back if the signal is no longer in kernel.

o Create two functions _thr_signal_init() and _thr_signal_deinit(),
  all signal action settings are retrieved from kernel when threading
  mode is turned on, after a fork(), child process will reset them to
  user settings by calling _thr_signal_deinit(). when threading mode
  is not turned on, all signal operations are direct past to kernel.

o When a thread generated a synchoronous signals and its context returned
  from completed list, UTS will retrieve the signal from its mailbox and try
  to deliver the signal to thread.

o Context signal mask is now only used when delivering signals, thread's
  current signal mask is always the one in pthread structure.

o Remove have_signals field in pthread structure, replace it with
  psf_valid in pthread_signal_frame. when psf_valid is true, in context
  switch time, thread will backout itself from some mutex/condition
  internal queues, then begin to process signals. when a thread is not
  at blocked state and running, check_pending indicates there are signals
  for the thread, after preempted and then resumed time, UTS will try to
  deliver signals to the thread.

o At signal delivering time, not only pending signals in thread will be
  scanned, process's pending signals will be scanned too.

o Change sigwait code a bit, remove field sigwait in pthread_wait_data,
  replace it with oldsigmask in pthread structure, when a thread calls
  sigwait(), its current signal mask is backuped to oldsigmask, and waitset
  is copied to its signal mask and when the thread gets a signal in the
  waitset range, its current signal mask is restored from oldsigmask,
  these are done in atomic fashion.

o Two additional POSIX APIs are implemented, sigwaitinfo() and sigtimedwait().

o Signal code locking is better than previous, there is fewer race conditions.

o Temporary disable most of code in _kse_single_thread as it is not safe
  after fork().
2003-06-28 09:55:02 +00:00
..
Makefile.inc Attempt to eliminate PLT relocations from rwlock aquire/release 2003-05-30 00:21:52 +00:00
thr_aio_suspend.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_destroy.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_get_np.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_getdetachstate.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getguardsize.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getinheritsched.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getschedparam.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getschedpolicy.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getscope.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getstack.c Add pthread_attr_getstack() and pthread_attr_setstack(). 2003-02-10 08:48:04 +00:00
thr_attr_getstackaddr.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_getstacksize.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_init.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_setcreatesuspend_np.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_setdetachstate.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_setguardsize.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_setinheritsched.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_setschedparam.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_setschedpolicy.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_setscope.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_attr_setstack.c Add pthread_attr_getstack() and pthread_attr_setstack(). 2003-02-10 08:48:04 +00:00
thr_attr_setstackaddr.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_attr_setstacksize.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_autoinit.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_cancel.c if thread is exiting, just returns. kse_thr_interrupt interface 2003-06-28 09:39:35 +00:00
thr_clean.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_close.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_concurrency.c Change low-level locking a bit so that we can tell if 2003-05-24 02:29:25 +00:00
thr_cond.c After thread was interrupted by signal, it should relock mutex. 2003-06-28 09:40:57 +00:00
thr_condattr_destroy.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_condattr_init.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_creat.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_create.c Write new thread pointer back only when success. 2003-06-28 09:41:59 +00:00
thr_detach.c Change low-level locking a bit so that we can tell if 2003-05-24 02:29:25 +00:00
thr_equal.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_exit.c Attempt to eliminate PLT relocations from rwlock aquire/release 2003-05-30 00:21:52 +00:00
thr_fcntl.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_find_thread.c Change low-level locking a bit so that we can tell if 2003-05-24 02:29:25 +00:00
thr_fork.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_fsync.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_getprio.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_getschedparam.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_info.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_init.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_join.c Change low-level locking a bit so that we can tell if 2003-05-24 02:29:25 +00:00
thr_kern.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_kill.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_main_np.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_mattr_init.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_mattr_kind_np.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_msync.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_multi_np.c Revamp suspend and resume. While I'm here add pthread_suspend_all_np() 2002-05-24 04:32:28 +00:00
thr_mutex_prioceiling.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_mutex_protocol.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_mutex.c Free memory of internal low level lock when mutex and condition variable 2003-06-03 02:21:01 +00:00
thr_mutexattr_destroy.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_nanosleep.c Change low-level locking a bit so that we can tell if 2003-05-24 02:29:25 +00:00
thr_once.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_open.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_pause.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_poll.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_printf.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_priority_queue.c o Don't add a scope system thread's KSE to the list of available 2003-04-28 23:56:12 +00:00
thr_private.h o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_pselect.c Eek, staticize a couple of functions that shouldn't 2003-05-19 23:04:50 +00:00
thr_read.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_readv.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_resume_np.c Fix suspend and resume. 2003-05-04 16:17:01 +00:00
thr_rtld.c Temporary disable rwlock based code, replace it with low level KSE locking 2003-06-28 09:47:22 +00:00
thr_rwlock.c Attempt to eliminate PLT relocations from rwlock aquire/release 2003-05-30 00:21:52 +00:00
thr_rwlockattr.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_select.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_self.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_sem.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_seterrno.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_setprio.c Make the changes needed for libpthread to compile in its new home. 2002-09-16 08:45:36 +00:00
thr_setschedparam.c Add an i386-specifc hack to always set %gs. There still seems 2003-04-21 04:02:56 +00:00
thr_sig.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_sigaction.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_sigmask.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_sigpending.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_sigprocmask.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_sigsuspend.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_sigwait.c o Use a daemon thread to monitor signal events in kernel, if pending 2003-06-28 09:55:02 +00:00
thr_single_np.c Revamp suspend and resume. While I'm here add pthread_suspend_all_np() 2002-05-24 04:32:28 +00:00
thr_sleep.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_spec.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_spinlock.c Don't really spin on a spinlock; silently convert it to the same 2003-05-29 17:10:45 +00:00
thr_stack.c Use mmap retuned value. 2003-06-28 09:48:05 +00:00
thr_suspend_np.c Fix suspend and resume. 2003-05-04 16:17:01 +00:00
thr_switch_np.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_system.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_tcdrain.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_vfork.c To be consistent, use the __weak_reference macro from <sys/cdefs.h> 2001-04-10 04:19:21 +00:00
thr_wait4.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_wait.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_waitpid.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_write.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_writev.c Revamp libpthread so that it has a chance of working in an SMP 2003-04-18 05:04:16 +00:00
thr_yield.c Add a method of yielding the current thread with the scheduler 2003-05-16 19:58:30 +00:00