inline testcancel() into thr_cancel_leave(), because cancel_pending is

almost false, this makes a slight better branch predicting.
This commit is contained in:
David Xu 2010-09-24 13:01:01 +00:00
parent 04ebad3842
commit e5c66a0d9e

View File

@ -158,6 +158,7 @@ void
_thr_cancel_leave(struct pthread *curthread, int maycancel)
{
curthread->cancel_point = 0;
if (maycancel)
testcancel(curthread);
if (__predict_false(SHOULD_CANCEL(curthread) &&
!THR_IN_CRITICAL(curthread) && maycancel))
_pthread_exit(PTHREAD_CANCELED);
}