diff options
| author | Jason Evans <jasone@FreeBSD.org> | 2000-06-14 17:17:41 +0000 |
|---|---|---|
| committer | Jason Evans <jasone@FreeBSD.org> | 2000-06-14 17:17:41 +0000 |
| commit | 314be1347ba3b74b5e67aad5053dba8919768624 (patch) | |
| tree | 5b1354c7e5ebafa899c00de702a53fbc1481f1fc /lib/libpthread/thread/thr_cancel.c | |
| parent | 979ab7516260eb8e17b93759826df578635fdbe9 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_cancel.c')
| -rw-r--r-- | lib/libpthread/thread/thr_cancel.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c index 82ddbb8b6565..c6df52ef5cc8 100644 --- a/lib/libpthread/thread/thr_cancel.c +++ b/lib/libpthread/thread/thr_cancel.c @@ -37,15 +37,6 @@ pthread_cancel(pthread_t pthread) pthread->cancelflags |= PTHREAD_CANCELLING; break; - case PS_SUSPENDED: - /* - * This thread isn't in any scheduling - * queues; just change it's state: - */ - pthread->cancelflags |= PTHREAD_CANCELLING; - PTHREAD_SET_STATE(pthread, PS_RUNNING); - break; - case PS_SPINBLOCK: case PS_FDR_WAIT: case PS_FDW_WAIT: @@ -67,6 +58,20 @@ pthread_cancel(pthread_t pthread) PTHREAD_NEW_STATE(pthread,PS_RUNNING); break; + case PS_SUSPENDED: + if (pthread->suspended == SUSP_NO || + pthread->suspended == SUSP_YES || + pthread->suspended == SUSP_NOWAIT) { + /* + * This thread isn't in any scheduling + * queues; just change it's state: + */ + pthread->cancelflags |= + PTHREAD_CANCELLING; + PTHREAD_SET_STATE(pthread, PS_RUNNING); + break; + } + /* FALLTHROUGH */ case PS_MUTEX_WAIT: case PS_COND_WAIT: case PS_FDLR_WAIT: |
