summaryrefslogtreecommitdiff
path: root/sys/kern/kern_lockf.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-03-24 03:57:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-03-24 03:57:44 +0000
commit8d2725181a1f509ba3ad8b1e530f5f970ebe1607 (patch)
tree766ee83c56bfe5c4429d905e22d8c8b1c565bfa5 /sys/kern/kern_lockf.c
parent386deae89c28deb5ed9ef1c74996dc157550e2e8 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_lockf.c')
-rw-r--r--sys/kern/kern_lockf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index 86855ea34836..6c96c9c0a485 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -234,6 +234,7 @@ lf_setlock(lock)
/* The block is waiting on something */
wproc = (struct proc *)block->lf_id;
+ mtx_lock_spin(&sched_lock);
while (wproc->p_wchan &&
(wproc->p_wmesg == lockstr) &&
(i++ < maxlockdepth)) {
@@ -244,10 +245,12 @@ lf_setlock(lock)
break;
wproc = (struct proc *)waitblock->lf_id;
if (wproc == (struct proc *)lock->lf_id) {
+ mtx_unlock_spin(&sched_lock);
free(lock, M_LOCKF);
return (EDEADLK);
}
}
+ mtx_unlock_spin(&sched_lock);
}
/*
* For flock type locks, we must first remove