diff options
author | jhb <jhb@FreeBSD.org> | 2006-11-15 20:44:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-11-15 20:44:07 +0000 |
commit | fa8eeee427c0d5a631c16971895f656030b56dc2 (patch) | |
tree | d368d940533b8e54806dbe88722e06a1d9eb337d /sys/kern/kern_synch.c | |
parent | 2f2c7a9146d5060826508b37ffff006732712c9f (diff) | |
download | FreeBSD-src-fa8eeee427c0d5a631c16971895f656030b56dc2.zip FreeBSD-src-fa8eeee427c0d5a631c16971895f656030b56dc2.tar.gz |
Adjust assertions to allow for magical properties of the 'lbolt' wait
channel for tsleep():
- Allow tsleep() on &lbolt without Giant with a timeout 0 since &lbolt has
an implied timeout.
- If &lbolt is used with msleep() pass NULL to sleepq_add() for the lock
object. Unlike other sleepq channels, &lbolt doesn't have an associated
owning lock.
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index e9fe9b6..b8082fd 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -135,8 +135,8 @@ msleep(ident, mtx, priority, wmesg, timo) #endif WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, mtx == NULL ? NULL : &mtx->mtx_object, "Sleeping on \"%s\"", wmesg); - KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL, - ("sleeping without a mutex")); + KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL || + ident == &lbolt, ("sleeping without a mutex")); KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); @@ -188,7 +188,7 @@ msleep(ident, mtx, priority, wmesg, timo) * stopped, then td will no longer be on a sleep queue upon * return from cursig(). */ - sleepq_add(ident, mtx, wmesg, flags); + sleepq_add(ident, ident == &lbolt ? NULL : mtx, wmesg, flags); if (timo) sleepq_set_timeout(ident, timo); |