diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-07-03 10:12:21 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-07-03 10:12:21 +0000 |
commit | 9fdfee8413ec2f0a91d30eacecaf2504ce8dc50c (patch) | |
tree | 4a59d2c78e3667e8a1c78d85d486c1cc12daec59 /lib/libpthread/thread/thr_kern.c | |
parent | e4b16fa2397b418b56b695021f87e5808224966a (diff) | |
download | FreeBSD-src-9fdfee8413ec2f0a91d30eacecaf2504ce8dc50c.zip FreeBSD-src-9fdfee8413ec2f0a91d30eacecaf2504ce8dc50c.tar.gz |
Check if thread is in critical region, only testing check_pending
is not enough.
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |