summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2001-03-09 16:05:43 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2001-03-09 16:05:43 +0000
commitaf4878847e8c5bdedb864089195450f18f3cb84c (patch)
tree28aced13cb10d05faaebf29471ce9e045b32330f
parent85ac71e9c655c1ae36c63ad8134a9c364176462f (diff)
Notes
-rw-r--r--lib/libc_r/uthread/uthread_sig.c10
-rw-r--r--lib/libkse/thread/thr_sig.c10
-rw-r--r--lib/libpthread/thread/thr_sig.c10
3 files changed, 24 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c
index a005adfe70f75..71a88efe4a30d 100644
--- a/lib/libc_r/uthread/uthread_sig.c
+++ b/lib/libc_r/uthread/uthread_sig.c
@@ -569,9 +569,9 @@ thread_sig_handle_special(int sig)
static void
thread_sig_add(pthread_t pthread, int sig, int has_args)
{
- struct pthread *curthread = _get_curthread();
int restart;
int suppress_handler = 0;
+ int thread_is_active = 0;
restart = _thread_sigact[sig - 1].sa_flags & SA_RESTART;
@@ -604,6 +604,12 @@ thread_sig_add(pthread_t pthread, int sig, int has_args)
*/
if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0)
PTHREAD_PRIOQ_REMOVE(pthread);
+ else
+ /*
+ * This thread is running; avoid placing it in
+ * the run queue:
+ */
+ thread_is_active = 1;
break;
case PS_SUSPENDED:
@@ -753,7 +759,7 @@ thread_sig_add(pthread_t pthread, int sig, int has_args)
* the thread in the run queue.
*/
pthread->active_priority |= PTHREAD_SIGNAL_PRIORITY;
- if (pthread != curthread)
+ if (thread_is_active == 0)
PTHREAD_PRIOQ_INSERT_TAIL(pthread);
}
}
diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c
index a005adfe70f75..71a88efe4a30d 100644
--- a/lib/libkse/thread/thr_sig.c
+++ b/lib/libkse/thread/thr_sig.c
@@ -569,9 +569,9 @@ thread_sig_handle_special(int sig)
static void
thread_sig_add(pthread_t pthread, int sig, int has_args)
{
- struct pthread *curthread = _get_curthread();
int restart;
int suppress_handler = 0;
+ int thread_is_active = 0;
restart = _thread_sigact[sig - 1].sa_flags & SA_RESTART;
@@ -604,6 +604,12 @@ thread_sig_add(pthread_t pthread, int sig, int has_args)
*/
if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0)
PTHREAD_PRIOQ_REMOVE(pthread);
+ else
+ /*
+ * This thread is running; avoid placing it in
+ * the run queue:
+ */
+ thread_is_active = 1;
break;
case PS_SUSPENDED:
@@ -753,7 +759,7 @@ thread_sig_add(pthread_t pthread, int sig, int has_args)
* the thread in the run queue.
*/
pthread->active_priority |= PTHREAD_SIGNAL_PRIORITY;
- if (pthread != curthread)
+ if (thread_is_active == 0)
PTHREAD_PRIOQ_INSERT_TAIL(pthread);
}
}
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index a005adfe70f75..71a88efe4a30d 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -569,9 +569,9 @@ thread_sig_handle_special(int sig)
static void
thread_sig_add(pthread_t pthread, int sig, int has_args)
{
- struct pthread *curthread = _get_curthread();
int restart;
int suppress_handler = 0;
+ int thread_is_active = 0;
restart = _thread_sigact[sig - 1].sa_flags & SA_RESTART;
@@ -604,6 +604,12 @@ thread_sig_add(pthread_t pthread, int sig, int has_args)
*/
if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0)
PTHREAD_PRIOQ_REMOVE(pthread);
+ else
+ /*
+ * This thread is running; avoid placing it in
+ * the run queue:
+ */
+ thread_is_active = 1;
break;
case PS_SUSPENDED:
@@ -753,7 +759,7 @@ thread_sig_add(pthread_t pthread, int sig, int has_args)
* the thread in the run queue.
*/
pthread->active_priority |= PTHREAD_SIGNAL_PRIORITY;
- if (pthread != curthread)
+ if (thread_is_active == 0)
PTHREAD_PRIOQ_INSERT_TAIL(pthread);
}
}