Lines Matching defs:lock
50 #include <sys/lock.h>
143 * The lock argument is unlocked before the caller is suspended, and
145 * flag the lock is not re-locked before returning.
148 _sleep(void *ident, struct lock_object *lock, int priority,
163 WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
165 KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL,
166 ("sleeping without a lock"));
170 KASSERT(lock != NULL && lock != &Giant.lock_object,
171 ("PDROP requires a non-Giant lock"));
172 if (lock != NULL)
173 class = LOCK_CLASS(lock);
186 if (lock != NULL && priority & PDROP)
187 class->lc_unlock(lock);
214 if (lock == &Giant.lock_object)
217 if (lock != NULL && lock != &Giant.lock_object &&
219 WITNESS_SAVE(lock, lock_witness);
220 lock_state = class->lc_unlock(lock);
234 sleepq_add(ident, lock, wmesg, flags, 0);
237 if (lock != NULL && class->lc_flags & LC_SLEEPABLE) {
239 WITNESS_SAVE(lock, lock_witness);
240 lock_state = class->lc_unlock(lock);
258 if (lock != NULL && lock != &Giant.lock_object && !(priority & PDROP)) {
259 class->lc_lock(lock, lock_state);
260 WITNESS_RESTORE(lock, lock_witness);
308 * Can't call ktrace with any spin locks held so it can lock the
309 * ktrace_mtx lock, and WITNESS_WARN considers it an error to hold
310 * any spin lock. Thus, we have to drop the sleepq spin lock while