summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_cancel.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2003-08-10 22:07:28 +0000
committerDavid Xu <davidxu@FreeBSD.org>2003-08-10 22:07:28 +0000
commit94fd4648c308534cb3e483ed46ed71bf93c32ef3 (patch)
treef8b09b3e7d6418c97a444b226d0861c976eaa105 /lib/libpthread/thread/thr_cancel.c
parente32ea5472ab82f2df64a6fe6a11d8d3e4509dd1d (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_cancel.c')
-rw-r--r--lib/libpthread/thread/thr_cancel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c
index 8190af6437bc..a29347c96d63 100644
--- a/lib/libpthread/thread/thr_cancel.c
+++ b/lib/libpthread/thread/thr_cancel.c
@@ -259,6 +259,8 @@ _pthread_testcancel(void)
void
_thr_enter_cancellation_point(struct pthread *thread)
{
+ if (!_kse_isthreaded())
+ return;
/* Look for a cancellation before we block: */
THR_SCHED_LOCK(thread, thread);
testcancel(thread);
@@ -269,6 +271,8 @@ _thr_enter_cancellation_point(struct pthread *thread)
void
_thr_leave_cancellation_point(struct pthread *thread)
{
+ if (!_kse_isthreaded())
+ return;
THR_SCHED_LOCK(thread, thread);
thread->cancelflags &= ~THR_AT_CANCEL_POINT;
/* Look for a cancellation after we unblock: */