From 9481d0539ded5c181074110b4561003edab1a015 Mon Sep 17 00:00:00 2001 From: mtm Date: Sat, 27 Mar 2004 14:39:21 +0000 Subject: Stop using signals for synchronizing threads. The performance penalty was too much. --- lib/libthr/thread/thr_kern.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'lib/libthr/thread/thr_kern.c') diff --git a/lib/libthr/thread/thr_kern.c b/lib/libthr/thread/thr_kern.c index 1073ffd..0f0305e 100644 --- a/lib/libthr/thread/thr_kern.c +++ b/lib/libthr/thread/thr_kern.c @@ -74,10 +74,6 @@ _thread_sigblock() * Block all signals. */ SIGFILLSET(set); - SIGADDSET(set, SIGTHR); -#ifdef _PTHREADS_INVARIANTS - SIGDELSET(set, SIGABRT); -#endif SIGDELSET(set, SIGTRAP); /* If we have already blocked signals, just up the refcount */ @@ -121,7 +117,6 @@ _thread_suspend(pthread_t pthread, const struct timespec *abstime) { struct timespec remaining; struct timespec *ts; - siginfo_t info; int error; /* @@ -139,19 +134,12 @@ _thread_suspend(pthread_t pthread, const struct timespec *abstime) ts = &remaining; /* - * If the absolute timeout has already passed set the - * relative timeout to 0 sec. so that sigtimedwait() - * returns immediately. * NOTE: timespecsub() makes sure the tv_nsec member >= 0. */ - if (ts->tv_sec < 0) { - ts->tv_sec = 0; - ts->tv_nsec = 0; - } + if (ts->tv_sec < 0) + return (ETIMEDOUT); } else ts = NULL; - - error = sigtimedwait(&_thread_suspend_sigset, &info, ts); - error = (error == -1) ? errno : 0; - return (error); + error = thr_suspend(ts); + return (error == -1 ? errno : error); } -- cgit v1.1