66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
.if n .pH ddi.rm/d3/gen/MUTEX_LOCK @(#)MUTEX_LOCK 43.11 of 12/5/92
|
|
.\" Copyright 1995, Silicon Graphics Computer Systems
|
|
.TH MUTEX_LOCK D3
|
|
.SH NAME
|
|
\f4MUTEX_LOCK\f1 \- acquire a mutual exclusion lock
|
|
.IX "\f4MUTEX_LOCK\f1(D3)"
|
|
.SH SYNOPSIS
|
|
.nf
|
|
.na
|
|
.ft 4
|
|
#include <sys/ksynch.h>
|
|
#include <sys/ddi.h>
|
|
.sp 0.4
|
|
void MUTEX_LOCK(mutex_t *\f2lockp\f1, int \f2priority\f1);
|
|
.ft 1
|
|
.ad
|
|
.fi
|
|
.SS Arguments
|
|
.RS 0
|
|
.IP "\f2lockp\f1" 10n
|
|
Pointer to the mutual exclusion lock to be acquired.
|
|
.IP "\f2priority\f1" 10n
|
|
Reserved for future use (must be equal to -1).
|
|
.RE
|
|
.SH DESCRIPTION
|
|
\f4MUTEX_LOCK\f1 acquires the mutual exclusion lock specified by \f2lockp\f1.
|
|
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.
|
|
.P
|
|
The caller will not be interrupted by signals while sleeping inside
|
|
\f4MUTEX_LOCK\f1.
|
|
.P
|
|
\f4MUTEX_LOCK\f1 differs from \f4SLEEP_LOCK\f1 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.
|
|
.SS "Return Values"
|
|
None
|
|
.SS Level
|
|
Base only.
|
|
.SS "Synchronization Constraints"
|
|
Can sleep.
|
|
.P
|
|
Driver-defined basic locks may not be held across calls to this function.
|
|
.P
|
|
Driver-defined sleep locks may be held across calls to this function
|
|
subject to the recursion restrictions described below.
|
|
.SS Warnings
|
|
Mutual exclusion locks are not recursive --
|
|
a call to \f4MUTEX_LOCK\f1 attempting to acquire a lock that is currently held
|
|
by the calling thread of execution will result in deadlock.
|
|
.SH REFERENCES
|
|
.na
|
|
\f4MUTEX_ALLOC\f1(D3),
|
|
\f4MUTEX_INIT\f1(D3),
|
|
\f4MUTEX_DEALLOC\f1(D3),
|
|
\f4MUTEX_DESTROY\f1(D3),
|
|
\f4MUTEX_TRYLOCK\f1(D3),
|
|
\f4MUTEX_UNLOCK\f1(D3),
|
|
\f4MUTEX_OWNED\f1(D3),
|
|
\f4MUTEX_MINE\f1(D3),
|
|
\f4SLEEP_LOCK\f1(D3).
|
|
.ad
|