mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
kernel: never do sched() in unlock() when not in "Running" state.
Some callers of unlock change the process state (such as qlock()) which means they are committed to calling sched() anyway, so no ned to call it internally.
This commit is contained in:
parent
381da3192f
commit
39321d74d8
1 changed files with 6 additions and 6 deletions
|
@ -204,13 +204,13 @@ unlock(Lock *l)
|
|||
coherence();
|
||||
l->key = 0;
|
||||
|
||||
if(up && --up->nlocks == 0 && up->delaysched && islo()){
|
||||
/*
|
||||
* Call sched if the need arose while locks were held
|
||||
* But, don't do it from interrupt routines, hence the islo() test
|
||||
*/
|
||||
/*
|
||||
* Call sched if the need arose while locks were held
|
||||
* But, don't do it from interrupt routines, hence the islo() test
|
||||
*/
|
||||
if(up && --up->nlocks == 0)
|
||||
if(up->state == Running && up->delaysched && islo())
|
||||
sched();
|
||||
}
|
||||
}
|
||||
|
||||
uintptr ilockpcs[0x100] = { [0xff] = 1 };
|
||||
|
|
Loading…
Reference in a new issue