strange KASSERT in _sleep()
rdivacky at freebsd.org
Sat Aug 11 06:03:35 PDT 2007
tsleep() maps to _sleep() with lock = NULL,
the _sleep() contains this:
KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL ||
ident == &lbolt, ("sleeping without a lock"));
which simplifies for tsleep(foo, ...) where foo != lbolt to
"timo != 0 || mtx_owned(&Giant)"
why do I have to hold Giant or have timo != 0 when calling tsleep?
thnx for explanation
More information about the freebsd-hackers