If thread mode is not activated yet, don't do extra work.

Reviewed by: deischen
This commit is contained in:
David Xu 2003-08-10 22:07:28 +00:00
parent e32ea5472a
commit 94fd4648c3
2 changed files with 8 additions and 0 deletions

View file

@ -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: */

View file

@ -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: */