From 9fdfee8413ec2f0a91d30eacecaf2504ce8dc50c Mon Sep 17 00:00:00 2001 From: davidxu Date: Thu, 3 Jul 2003 10:12:21 +0000 Subject: Check if thread is in critical region, only testing check_pending is not enough. --- lib/libpthread/thread/thr_kern.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libpthread/thread/thr_kern.c') diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index f7575ad..d2567b7 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -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) { -- cgit v1.1