Don't cancel thread if it is in critical region.

This commit is contained in:
David Xu 2006-03-25 07:03:13 +00:00
parent 0472dafab4
commit efe33769b9

View File

@ -77,7 +77,7 @@ testcancel(struct pthread *curthread)
int newval;
newval = curthread->cancelflags;
if (SHOULD_CANCEL(newval))
if (SHOULD_CANCEL(newval) && !THR_IN_CRITICAL(curthread))
pthread_exit(PTHREAD_CANCELED);
}