diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-08-30 07:40:48 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-08-30 07:40:48 +0000 |
commit | 170995a1ce142b2c1aba409e075ace0d01198fc8 (patch) | |
tree | e94c2a564d4f66d9cc516fe90f42b8af0275e605 /lib/libpthread/uthread/uthread_cancel.c | |
parent | b9a6bccdad5f3d2f0c9e0ed1d2d665ee341d056c (diff) |
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.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 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; |