summaryrefslogtreecommitdiff
path: root/lib/libpthread/uthread/uthread_cancel.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-09-04 22:17:46 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-09-04 22:17:46 +0000
commit2544c0965f03f1ad1de37d49854dff96e5b00ed3 (patch)
tree5bdbeb36f6ced3971be84ab3a9d85bdd45530ef3 /lib/libpthread/uthread/uthread_cancel.c
parentb7924acd437f1e99ff98330256cff6136d42ff02 (diff)
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.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 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;