From 353a1595901871d337f0fc645d99a02fe0f99228 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Wed, 26 Aug 1998 20:50:42 +0000 Subject: [PATCH] Back out most of the last commit. It created problems with sigpause. --- lib/libc_r/uthread/uthread_sig.c | 27 +-------------------------- lib/libkse/thread/thr_sig.c | 27 +-------------------------- lib/libpthread/thread/thr_sig.c | 27 +-------------------------- 3 files changed, 3 insertions(+), 78 deletions(-) diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c index 073b1ba05784..be3da9a27937 100644 --- a/lib/libc_r/uthread/uthread_sig.c +++ b/lib/libc_r/uthread/uthread_sig.c @@ -212,31 +212,6 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp) sigdelset(&pthread->sigpend,SIGCONT); } - /* - * Enter a loop to process each thread in the linked - * list that is sigwait-ing on a signal. Since POSIX - * doesn't specify which thread will get the signal - * if there are multiple waiters, we'll give it to the - * first one we find. - */ - for (pthread = _thread_link_list; pthread != NULL; - pthread = pthread->nxt) { - if ((pthread->state == PS_SIGWAIT) && - sigismember(&pthread->sigmask, sig)) { - /* Change the state of the thread to run: */ - PTHREAD_NEW_STATE(pthread,PS_RUNNING); - - /* Return the signal number: */ - pthread->signo = sig; - - /* - * Do not attempt to deliver this signal - * to other threads. - */ - return; - } - } - /* Check if the signal is not being ignored: */ if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) /* @@ -284,7 +259,6 @@ _thread_signal(pthread_t pthread, int sig) case PS_RUNNING: case PS_STATE_MAX: case PS_SIGTHREAD: - case PS_SIGWAIT: case PS_SUSPENDED: /* Nothing to do here. */ break; @@ -317,6 +291,7 @@ _thread_signal(pthread_t pthread, int sig) case PS_FDW_WAIT: case PS_SLEEP_WAIT: case PS_SELECT_WAIT: + case PS_SIGWAIT: if (sig != SIGCHLD || _thread_sigact[sig - 1].sa_handler != SIG_DFL) { /* Flag the operation as interrupted: */ diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c index 073b1ba05784..be3da9a27937 100644 --- a/lib/libkse/thread/thr_sig.c +++ b/lib/libkse/thread/thr_sig.c @@ -212,31 +212,6 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp) sigdelset(&pthread->sigpend,SIGCONT); } - /* - * Enter a loop to process each thread in the linked - * list that is sigwait-ing on a signal. Since POSIX - * doesn't specify which thread will get the signal - * if there are multiple waiters, we'll give it to the - * first one we find. - */ - for (pthread = _thread_link_list; pthread != NULL; - pthread = pthread->nxt) { - if ((pthread->state == PS_SIGWAIT) && - sigismember(&pthread->sigmask, sig)) { - /* Change the state of the thread to run: */ - PTHREAD_NEW_STATE(pthread,PS_RUNNING); - - /* Return the signal number: */ - pthread->signo = sig; - - /* - * Do not attempt to deliver this signal - * to other threads. - */ - return; - } - } - /* Check if the signal is not being ignored: */ if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) /* @@ -284,7 +259,6 @@ _thread_signal(pthread_t pthread, int sig) case PS_RUNNING: case PS_STATE_MAX: case PS_SIGTHREAD: - case PS_SIGWAIT: case PS_SUSPENDED: /* Nothing to do here. */ break; @@ -317,6 +291,7 @@ _thread_signal(pthread_t pthread, int sig) case PS_FDW_WAIT: case PS_SLEEP_WAIT: case PS_SELECT_WAIT: + case PS_SIGWAIT: if (sig != SIGCHLD || _thread_sigact[sig - 1].sa_handler != SIG_DFL) { /* Flag the operation as interrupted: */ diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c index 073b1ba05784..be3da9a27937 100644 --- a/lib/libpthread/thread/thr_sig.c +++ b/lib/libpthread/thread/thr_sig.c @@ -212,31 +212,6 @@ _thread_sig_handler(int sig, int code, struct sigcontext * scp) sigdelset(&pthread->sigpend,SIGCONT); } - /* - * Enter a loop to process each thread in the linked - * list that is sigwait-ing on a signal. Since POSIX - * doesn't specify which thread will get the signal - * if there are multiple waiters, we'll give it to the - * first one we find. - */ - for (pthread = _thread_link_list; pthread != NULL; - pthread = pthread->nxt) { - if ((pthread->state == PS_SIGWAIT) && - sigismember(&pthread->sigmask, sig)) { - /* Change the state of the thread to run: */ - PTHREAD_NEW_STATE(pthread,PS_RUNNING); - - /* Return the signal number: */ - pthread->signo = sig; - - /* - * Do not attempt to deliver this signal - * to other threads. - */ - return; - } - } - /* Check if the signal is not being ignored: */ if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) /* @@ -284,7 +259,6 @@ _thread_signal(pthread_t pthread, int sig) case PS_RUNNING: case PS_STATE_MAX: case PS_SIGTHREAD: - case PS_SIGWAIT: case PS_SUSPENDED: /* Nothing to do here. */ break; @@ -317,6 +291,7 @@ _thread_signal(pthread_t pthread, int sig) case PS_FDW_WAIT: case PS_SLEEP_WAIT: case PS_SELECT_WAIT: + case PS_SIGWAIT: if (sig != SIGCHLD || _thread_sigact[sig - 1].sa_handler != SIG_DFL) { /* Flag the operation as interrupted: */