summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_sig.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_sig.c')
-rw-r--r--lib/libthr/thread/thr_sig.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index efc6d5a..8a805af 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -93,80 +93,3 @@ _pthread_kill(pthread_t pthread, int sig)
return (thr_kill(pthread->thr_id, sig));
}
-
-/*
- * User thread signal handler wrapper.
- */
-void
-_thread_sig_wrapper(int sig, siginfo_t *info, void *context)
-{
- struct pthread_state_data psd;
- struct sigaction *actp;
- __siginfohandler_t *handler;
- struct umtx *up;
- spinlock_t *sp;
-
- /*
- * Do a little cleanup handling for those threads in
- * queues before calling the signal handler. Signals
- * for these threads are temporarily blocked until
- * after cleanup handling.
- */
- switch (curthread->state) {
- case PS_BARRIER_WAIT:
- /*
- * XXX - The thread has reached the barrier. We can't
- * "back it away" from the barrier.
- */
- _thread_critical_enter(curthread);
- break;
- case PS_COND_WAIT:
- /*
- * Cache the address, since it will not be available
- * after it has been backed out.
- */
- up = &curthread->data.cond->c_lock;
-
- UMTX_LOCK(up);
- _thread_critical_enter(curthread);
- _cond_wait_backout(curthread);
- UMTX_UNLOCK(up);
- break;
- case PS_MUTEX_WAIT:
- /*
- * Cache the address, since it will not be available
- * after it has been backed out.
- */
- sp = &curthread->data.mutex->lock;
-
- _SPINLOCK(sp);
- _thread_critical_enter(curthread);
- _mutex_lock_backout(curthread);
- _SPINUNLOCK(sp);
- break;
- default:
- /*
- * We need to lock the thread to read it's flags.
- */
- _thread_critical_enter(curthread);
- break;
- }
-
- /*
- * We save the flags now so that any modifications done as part
- * of the backout are reflected when the flags are restored.
- */
- psd.psd_flags = curthread->flags;
-
- PTHREAD_SET_STATE(curthread, PS_RUNNING);
- _thread_critical_exit(curthread);
- actp = proc_sigact_sigaction(sig);
- handler = (__siginfohandler_t *)actp->sa_handler;
- handler(sig, info, (ucontext_t *)context);
-
- /* Restore the thread's flags, and make it runnable */
- _thread_critical_enter(curthread);
- curthread->flags = psd.psd_flags;
- PTHREAD_SET_STATE(curthread, PS_RUNNING);
- _thread_critical_exit(curthread);
-}
OpenPOWER on IntegriCloud