summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_cancel.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-05-24 04:32:28 +0000
committerdeischen <deischen@FreeBSD.org>2002-05-24 04:32:28 +0000
commit9ba1f9fa381dcbfb861533fdda13f9f27da78f14 (patch)
tree15691e04d3960954bb9843fcfd9d5beaf2553f80 /lib/libpthread/thread/thr_cancel.c
parentabd4f3d6cc97e6f9042d207b7f1442f11860e88d (diff)
downloadFreeBSD-src-9ba1f9fa381dcbfb861533fdda13f9f27da78f14.zip
FreeBSD-src-9ba1f9fa381dcbfb861533fdda13f9f27da78f14.tar.gz
Revamp suspend and resume. While I'm here add pthread_suspend_all_np()
and pthread_resume_all_np(). These suspend and resume all threads except the current thread, respectively. The existing functions pthread_single_np() and pthread_multi_np(), which formerly had no effect, now exhibit the same behaviour and pthread_suspend_all_np() and pthread_resume_all_np(). These functions have been added mostly for the native java port. Don't allow the uthread kernel pipe to use the same descriptors as stdio. Mostily submitted by Oswald Buddenhagen <ossi@kde.org>. Correct some minor style nits.
Diffstat (limited to 'lib/libpthread/thread/thr_cancel.c')
-rw-r--r--lib/libpthread/thread/thr_cancel.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c
index b6b070f..d9324ab 100644
--- a/lib/libpthread/thread/thr_cancel.c
+++ b/lib/libpthread/thread/thr_cancel.c
@@ -78,20 +78,6 @@ _pthread_cancel(pthread_t pthread)
break;
case PS_SUSPENDED:
- if (pthread->suspended == SUSP_NO ||
- pthread->suspended == SUSP_YES ||
- pthread->suspended == SUSP_JOIN ||
- 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:
@@ -109,7 +95,7 @@ _pthread_cancel(pthread_t pthread)
*/
pthread->interrupted = 1;
pthread->cancelflags |= PTHREAD_CANCEL_NEEDED;
- PTHREAD_NEW_STATE(pthread,PS_RUNNING);
+ PTHREAD_NEW_STATE(pthread, PS_RUNNING);
pthread->continuation = finish_cancellation;
break;
OpenPOWER on IntegriCloud