diff options
author | 2001-09-04 22:17:44 +0000 | |
---|---|---|
committer | 2001-09-04 22:17:44 +0000 | |
commit | 76255b28fcbd9cdd77f49c23b6b60f68de906f88 (patch) | |
tree | 8b1adfbd865f3ad766fe5ed55b5dc298f9670823 /lib/libpthread/uthread/uthread_cancel.c | |
parent | Fix a diagnostic (diff) | |
download | wireguard-openbsd-76255b28fcbd9cdd77f49c23b6b60f68de906f88.tar.xz wireguard-openbsd-76255b28fcbd9cdd77f49c23b6b60f68de906f88.zip |
put changes back, this time ALL the files.
Diffstat (limited to 'lib/libpthread/uthread/uthread_cancel.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_cancel.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_cancel.c b/lib/libpthread/uthread/uthread_cancel.c index 8700d3e68b6..7f53aed66ce 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.5 2001/08/30 17:47:57 todd Exp $ */ +/* $OpenBSD: uthread_cancel.c,v 1.6 2001/09/04 22:17:45 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; |