summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-01-06 09:49:16 +0000
committerotto <otto@openbsd.org>2006-01-06 09:49:16 +0000
commitcbae9b0e1b4a71687a0e339b9f65f0de7b1900d0 (patch)
tree8bb1be10569e067bbf52c7a5ff830f81e01986fb
parentSudden newline (diff)
downloadwireguard-openbsd-cbae9b0e1b4a71687a0e339b9f65f0de7b1900d0.tar.xz
wireguard-openbsd-cbae9b0e1b4a71687a0e339b9f65f0de7b1900d0.zip
When suspending, check the tid of the arg, not of ourselves, doh
-rw-r--r--lib/librthread/rthread_sched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/librthread/rthread_sched.c b/lib/librthread/rthread_sched.c
index 584fd64f6a2..c7a2268437e 100644
--- a/lib/librthread/rthread_sched.c
+++ b/lib/librthread/rthread_sched.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_sched.c,v 1.6 2006/01/02 20:48:04 otto Exp $ */
+/* $OpenBSD: rthread_sched.c,v 1.7 2006/01/06 09:49:16 otto Exp $ */
/*
* Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -138,7 +138,7 @@ pthread_suspend_np(pthread_t thread)
* XXX Avoid a bug in current signal handling by refusing to
* suspend the main thread.
*/
- if (pthread_main_np() == 0)
+ if (thread->tid != _initial_thread.tid)
if (kill(thread->tid, SIGSTOP) == -1)
errn = errno;
return (errn);