summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_cancel.c
diff options
context:
space:
mode:
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 8190af6..a29347c 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: */
OpenPOWER on IntegriCloud