mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
- Correct a major error introduced in the per-cpu timeout commit. Sleep
and wakeup require the same wait channel to function properly. Found by: kris Pointy hat: me
This commit is contained in:
parent
a90c089ccd
commit
ce62b59c88
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177949
@ -655,7 +655,7 @@ _callout_stop_safe(c, safe)
|
||||
c, c->c_func, c->c_arg);
|
||||
CC_UNLOCK(cc);
|
||||
if (sq_locked)
|
||||
sleepq_release(&cc->cc_curr);
|
||||
sleepq_release(&cc->cc_waiting);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -687,17 +687,17 @@ _callout_stop_safe(c, safe)
|
||||
*/
|
||||
if (!sq_locked) {
|
||||
CC_UNLOCK(cc);
|
||||
sleepq_lock(&cc->cc_curr);
|
||||
sleepq_lock(&cc->cc_waiting);
|
||||
sq_locked = 1;
|
||||
goto again;
|
||||
}
|
||||
cc->cc_waiting = 1;
|
||||
DROP_GIANT();
|
||||
CC_UNLOCK(cc);
|
||||
sleepq_add(&cc->cc_curr,
|
||||
sleepq_add(&cc->cc_waiting,
|
||||
&cc->cc_lock.lock_object, "codrain",
|
||||
SLEEPQ_SLEEP, 0);
|
||||
sleepq_wait(&cc->cc_curr, 0);
|
||||
sleepq_wait(&cc->cc_waiting, 0);
|
||||
sq_locked = 0;
|
||||
|
||||
/* Reacquire locks previously released. */
|
||||
@ -726,7 +726,7 @@ _callout_stop_safe(c, safe)
|
||||
return (0);
|
||||
}
|
||||
if (sq_locked)
|
||||
sleepq_release(&cc->cc_curr);
|
||||
sleepq_release(&cc->cc_waiting);
|
||||
|
||||
c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user