From b213a2432e715efb62c35678c43365b8f84128f9 Mon Sep 17 00:00:00 2001 From: davidxu Date: Sun, 10 Aug 2003 22:07:28 +0000 Subject: If thread mode is not activated yet, don't do extra work. Reviewed by: deischen --- lib/libkse/thread/thr_cancel.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libkse/thread/thr_cancel.c') diff --git a/lib/libkse/thread/thr_cancel.c b/lib/libkse/thread/thr_cancel.c index 8190af6..a29347c 100644 --- a/lib/libkse/thread/thr_cancel.c +++ b/lib/libkse/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: */ -- cgit v1.1