Lines Matching defs:lock

53 #include <sys/lock.h>
82 PMC_SOFT_DEFINE( , , lock, failed);
94 static void assert_mtx(struct lock_object *lock, int what);
96 static void db_show_mtx(struct lock_object *lock);
98 static void lock_mtx(struct lock_object *lock, int how);
99 static void lock_spin(struct lock_object *lock, int how);
101 static int owner_mtx(struct lock_object *lock, struct thread **owner);
103 static int unlock_mtx(struct lock_object *lock);
104 static int unlock_spin(struct lock_object *lock);
143 assert_mtx(struct lock_object *lock, int what)
146 mtx_assert((struct mtx *)lock, what);
150 lock_mtx(struct lock_object *lock, int how)
153 mtx_lock((struct mtx *)lock);
157 lock_spin(struct lock_object *lock, int how)
164 unlock_mtx(struct lock_object *lock)
168 m = (struct mtx *)lock;
175 unlock_spin(struct lock_object *lock)
183 owner_mtx(struct lock_object *lock, struct thread **owner)
185 struct mtx *m = (struct mtx *)lock;
286 * Tries to acquire lock `m.' If this function is called on a mutex that
287 * is already owned, it will recursively acquire the lock.
332 * _mtx_lock_sleep: the tougher part of acquiring an MTX_DEF lock.
334 * We call this if the lock is either contested (i.e. we need to go to
374 PMC_SOFT_CALL( , , lock, failed);
380 "_mtx_lock_sleep: %s contested (lock=%p) at %s:%d",
390 * owner stops running or the state of the lock changes.
416 * Check if the lock has been released while spinning for
417 * the turnstile chain lock.
426 * The current lock owner might have started executing
427 * on another CPU (or the lock could have changed
429 * chain lock. If so, drop the turnstile lock and try
451 * We definitely must sleep for this lock.
510 printf( "spin lock %p (%s) held by %p (tid %d) too long\n",
515 panic("spin lock held too long");
520 * _mtx_lock_spin: the tougher part of acquiring an MTX_SPIN lock.
522 * This is only called if we need to actually spin for the lock. Recursion
542 PMC_SOFT_CALL( , , lock, failed);
616 PMC_SOFT_CALL( , , lock, failed);
655 struct mtx *lock;
658 lock = td->td_lock;
660 mtx_unlock_spin(lock);
662 return (lock);
676 struct mtx *lock;
680 lock = td->td_lock;
682 mtx_unlock_spin(lock);
686 * _mtx_unlock_sleep: the tougher part of releasing an MTX_DEF lock.
688 * We are only called here if the lock is recursed or contested (i.e. we
708 * We have to lock the chain before the turnstile so this turnstile
721 * unlock the chain lock so a new turnstile may take it's place.
812 * Mutex initialization routine; initialize lock `m' of type contained in
814 * lock type `type' is used as a general lock category name for use with
834 /* Determine lock class and lock flags. */
859 * Remove lock `m' from all_mtx queue. We don't allow MTX_QUIET to be
905 mtx_init(&blocked_lock, "blocked lock", NULL, MTX_SPIN);
907 mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
915 db_show_mtx(struct lock_object *lock)
920 m = (struct mtx *)lock;
923 if (LOCK_CLASS(lock) == &lock_class_mtx_spin)