diff options
author | jhb <jhb@FreeBSD.org> | 2008-09-25 13:42:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-09-25 13:42:19 +0000 |
commit | 9c5408c4f9e8c70d84545b90a85af2d1630f087d (patch) | |
tree | 7eaa8e1950a106baf0107b59b8404d89167c4544 /sys/kern/kern_synch.c | |
parent | af76980ef5353eee84271a4934c37c01861d8644 (diff) | |
download | FreeBSD-src-9c5408c4f9e8c70d84545b90a85af2d1630f087d.zip FreeBSD-src-9c5408c4f9e8c70d84545b90a85af2d1630f087d.tar.gz |
- Don't do a WITNESS_SAVE() on the interlock if it is Giant in the condition
variable wait routines. DROP_GIANT() already manages that state in the
Giant interlock case.
- Assert that Giant is held when it is passed as a sleep interlock.
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 9b7804b..4f1205d 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -181,6 +181,8 @@ _sleep(void *ident, struct lock_object *lock, int priority, CTR5(KTR_PROC, "sleep: thread %ld (pid %ld, %s) on %s (%p)", td->td_tid, p->p_pid, td->td_name, wmesg, ident); + if (lock == &Giant.lock_object) + mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); if (lock != NULL && lock != &Giant.lock_object && !(class->lc_flags & LC_SLEEPABLE)) { |