summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/uthread
diff options
context:
space:
mode:
authord <d@openbsd.org>1999-01-17 23:49:48 +0000
committerd <d@openbsd.org>1999-01-17 23:49:48 +0000
commita216fd63eac8b016dc2a979383ab7441f274c65c (patch)
treed5d9dcd929ea6460a98a6a3f6380b31c3771caa6 /lib/libpthread/uthread
parentpthread_atfork() (diff)
downloadwireguard-openbsd-a216fd63eac8b016dc2a979383ab7441f274c65c.tar.xz
wireguard-openbsd-a216fd63eac8b016dc2a979383ab7441f274c65c.zip
mi+md jmp_buf; save i386s fs and gs for WINE (csapuntz@stanford.edu)
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r--lib/libpthread/uthread/uthread_kern.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_kern.c b/lib/libpthread/uthread/uthread_kern.c
index 74499e597d5..8d6f58754e6 100644
--- a/lib/libpthread/uthread/uthread_kern.c
+++ b/lib/libpthread/uthread/uthread_kern.c
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* $FreeBSD: uthread_kern.c,v 1.15 1998/11/15 09:58:26 jb Exp $
- * $OpenBSD: uthread_kern.c,v 1.5 1999/01/10 23:16:35 d Exp $
+ * $OpenBSD: uthread_kern.c,v 1.6 1999/01/17 23:49:49 d Exp $
*
*/
#include <errno.h>
@@ -101,6 +101,20 @@ _thread_kern_sched(struct sigcontext * scp)
*/
_thread_kern_in_sched = 0;
+ if (!(_thread_run->flags & PTHREAD_AT_CANCEL_POINT) &&
+ (_thread_run->canceltype == PTHREAD_CANCEL_ASYNCHRONOUS)) {
+ /*
+ * Cancelations override signals.
+ *
+ * Stick a cancellation point at the start of
+ * each async-cancellable thread's resumption.
+ *
+ * We allow threads woken at cancel points to do their
+ * own checks.
+ */
+ _thread_cancellation_point();
+ }
+
/*
* There might be pending signals for this thread, so
* dispatch any that aren't blocked: