From 2544c0965f03f1ad1de37d49854dff96e5b00ed3 Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Tue, 4 Sep 2001 22:17:46 +0000 Subject: put changes back, this time ALL the files. --- lib/libpthread/uthread/uthread_cancel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/libpthread/uthread/uthread_cancel.c') 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 , 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; -- cgit v1.2.3