diff options
author | mtm <mtm@FreeBSD.org> | 2004-03-27 14:39:21 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2004-03-27 14:39:21 +0000 |
commit | 9481d0539ded5c181074110b4561003edab1a015 (patch) | |
tree | 458ef2db8a501d133444eecda22e11a529a5c6ea /lib/libthr/thread/thr_kern.c | |
parent | 02e9e2319ae04ec9ce99369c799e56b81f210ee7 (diff) | |
download | FreeBSD-src-9481d0539ded5c181074110b4561003edab1a015.zip FreeBSD-src-9481d0539ded5c181074110b4561003edab1a015.tar.gz |
Stop using signals for synchronizing threads. The performance penalty
was too much.
Diffstat (limited to 'lib/libthr/thread/thr_kern.c')
-rw-r--r-- | lib/libthr/thread/thr_kern.c | 20 |
1 files changed, 4 insertions, 16 deletions
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); } |