Tweak _thr_cancel_leave_defer a bit to fix a possible race.

This commit is contained in:
David Xu 2006-12-05 05:01:57 +00:00
parent 6e4f008cbb
commit 3ce4e91d4e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164896

View File

@ -170,9 +170,13 @@ void
_thr_cancel_leave_defer(struct pthread *curthread, int check)
{
if (curthread->cancel_enable) {
curthread->cancel_defer--;
if (check)
if (!check) {
curthread->cancel_point--;
curthread->cancel_defer--;
} else {
curthread->cancel_defer--;
testcancel(curthread);
curthread->cancel_point--;
curthread->cancel_point--;
}
}
}