Check if thread is in critical region, only testing check_pending

is not enough.
This commit is contained in:
David Xu 2003-07-03 10:12:21 +00:00
parent 9b5c4b6694
commit 8b258c151d
2 changed files with 4 additions and 2 deletions

View File

@ -673,7 +673,8 @@ _thr_sched_switch_unlocked(struct pthread *curthread)
/*
* This thread is being resumed; check for cancellations.
*/
if ((psf.psf_valid || curthread->check_pending)) {
if ((psf.psf_valid ||
(curthread->check_pending && !THR_IN_CRITICAL(curthread)))) {
resume_once = 0;
THR_GETCONTEXT(&uc);
if (resume_once == 0) {

View File

@ -673,7 +673,8 @@ _thr_sched_switch_unlocked(struct pthread *curthread)
/*
* This thread is being resumed; check for cancellations.
*/
if ((psf.psf_valid || curthread->check_pending)) {
if ((psf.psf_valid ||
(curthread->check_pending && !THR_IN_CRITICAL(curthread)))) {
resume_once = 0;
THR_GETCONTEXT(&uc);
if (resume_once == 0) {