MUTEX_LOCK(D3)MUTEX_LOCK(D3)NAMEMUTEX_LOCK - acquire a mutual exclusion lock
SYNOPSIS
#include <sys/ksynch.h>
#include <sys/ddi.h>
void MUTEX_LOCK(mutex_t *lockp, int priority);
Arguments
lockp Pointer to the mutual exclusion lock to be acquired.
priority Reserved for future use (must be equal to -1).
DESCRIPTIONMUTEX_LOCK acquires the mutual exclusion lock specified by lockp. If the
lock is not immediately available, the calling thread of execution blocks
until the lock becomes available to the caller, at which point the caller
is reactivated and returns with the lock held.
The caller will not be interrupted by signals while sleeping inside
MUTEX_LOCK.
MUTEX_LOCK differs from SLEEP_LOCK in that it implements priority
inheritance -- the owner of the lock inherits the scheduling priority of
any callers waiting for the lock if any of the waiters are running at a
higher priority than the owner. The original priority is reinstated when
the lock is released.
Return Values
None
Level
Base only.
Synchronization Constraints
Can sleep.
Driver-defined basic locks may not be held across calls to this function.
Driver-defined sleep locks may be held across calls to this function
subject to the recursion restrictions described below.
Warnings
Mutual exclusion locks are not recursive -- a call to MUTEX_LOCK
attempting to acquire a lock that is currently held by the calling thread
of execution will result in deadlock.
REFERENCESMUTEX_ALLOC(D3), MUTEX_INIT(D3), MUTEX_DEALLOC(D3), MUTEX_DESTROY(D3),
MUTEX_TRYLOCK(D3), MUTEX_UNLOCK(D3), MUTEX_OWNED(D3), MUTEX_MINE(D3),
SLEEP_LOCK(D3).
Page 1