mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
lockf: perform wakeup onlly when there is anybody waiting
Tested by: pho
This commit is contained in:
parent
c72ead2815
commit
717df0b0e8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332880
@ -724,10 +724,11 @@ lf_advlockasync(struct vop_advlockasync_args *ap, struct lockf **statep,
|
||||
VI_LOCK(vp);
|
||||
|
||||
state->ls_threads--;
|
||||
wakeup(state);
|
||||
if (LIST_EMPTY(&state->ls_active) && state->ls_threads == 0) {
|
||||
KASSERT(LIST_EMPTY(&state->ls_pending),
|
||||
("freeable state with pending locks"));
|
||||
} else {
|
||||
wakeup(state);
|
||||
}
|
||||
|
||||
VI_UNLOCK(vp);
|
||||
|
Loading…
Reference in New Issue
Block a user