summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_kern.c
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>2003-06-29 15:55:44 +0000
committerjdp <jdp@FreeBSD.org>2003-06-29 15:55:44 +0000
commit536016ad69db3ca3302cc7996846b12dbc8d5cf8 (patch)
tree7cca05bdbddd83b9e8f9d07ab187f59490dda694 /lib/libthr/thread/thr_kern.c
parentf7d7f36d14ab77dae9c50dba93e92f21f3a5854d (diff)
downloadFreeBSD-src-536016ad69db3ca3302cc7996846b12dbc8d5cf8.zip
FreeBSD-src-536016ad69db3ca3302cc7996846b12dbc8d5cf8.tar.gz
Make _thread_suspend work with both the old broken sigtimedwait
implementation and the new improved one. We now precompute the signal set passed to sigtimedwait, using an inverted set when necessary for compatibility with older kernels.
Diffstat (limited to 'lib/libthr/thread/thr_kern.c')
-rw-r--r--lib/libthr/thread/thr_kern.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/libthr/thread/thr_kern.c b/lib/libthr/thread/thr_kern.c
index 1c9a8ce..f45cae5 100644
--- a/lib/libthr/thread/thr_kern.c
+++ b/lib/libthr/thread/thr_kern.c
@@ -179,16 +179,9 @@ _thread_suspend(pthread_t pthread, struct timespec *abstime)
struct timespec remaining;
struct timespec *ts;
siginfo_t info;
- sigset_t set;
int error;
/*
- * Catch SIGTHR.
- */
- SIGFILLSET(set);
- SIGDELSET(set, SIGTHR);
-
- /*
* Compute the remainder of the run time.
*/
if (abstime) {
@@ -204,9 +197,7 @@ _thread_suspend(pthread_t pthread, struct timespec *abstime)
} else
ts = NULL;
- error = sigtimedwait(&set, &info, ts);
- if (error == -1)
- error = errno;
-
+ error = sigtimedwait(&_thread_suspend_sigset, &info, ts);
+ error = (error == -1) ? errno : 0;
return (error);
}
OpenPOWER on IntegriCloud