summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/uthread/uthread_cancel.c
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2001-08-30 07:40:47 +0000
committerfgsch <fgsch@openbsd.org>2001-08-30 07:40:47 +0000
commit528f4536a6ed082030054573aa8809652f56e2b3 (patch)
tree1fa20fdae6720f94dd4a26dd9def589870697529 /lib/libpthread/uthread/uthread_cancel.c
parentfix some const warnings (diff)
downloadwireguard-openbsd-528f4536a6ed082030054573aa8809652f56e2b3.tar.xz
wireguard-openbsd-528f4536a6ed082030054573aa8809652f56e2b3.zip
fix some const warnings.
more sync with freebsd.
Diffstat (limited to 'lib/libpthread/uthread/uthread_cancel.c')
-rw-r--r--lib/libpthread/uthread/uthread_cancel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_cancel.c b/lib/libpthread/uthread/uthread_cancel.c
index 7428ee07ecb..7b157c2b53e 100644
--- a/lib/libpthread/uthread/uthread_cancel.c
+++ b/lib/libpthread/uthread/uthread_cancel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_cancel.c,v 1.3 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_cancel.c,v 1.4 2001/08/30 07:40:47 fgsch Exp $ */
/*
* David Leonard <d@openbsd.org>, 1999. Public domain.
*/
@@ -12,7 +12,10 @@ pthread_cancel(pthread)
{
int ret;
- if ((ret = _find_thread(pthread))) {
+ if ((ret = _find_thread(pthread)) != 0) {
+ /* NOTHING */
+ } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK) {
+ ret = 0;
} else if ((pthread->flags & PTHREAD_FLAGS_CANCELED) == 0) {
/* Set the thread's I've-been-cancelled flag: */
pthread->flags |= PTHREAD_FLAGS_CANCELED;