try to acquire a basic lock
pl_t TRYLOCK(lock_t *lockp, pl_t pl);
If the lock specified by lockp is immediately available (can be
acquired without waiting)
TRYLOCK sets the interrupt priority level in accordance with the value
specified by pl (if required by the implementation)
and acquires the lock.
If the lock is not immediately available, the function returns without
acquiring the lock.
Pointer to the basic lock to be acquired.
The interrupt priority level to be set while the lock is held
by the caller.
If the lock is acquired, TRYLOCK returns the previous interrupt priority
level (plbase - plhi).
If the lock is not acquired the value invpl is returned.
Because some implementations require that interrupts that might attempt
to acquire the lock be blocked on the processor on which the lock is
held, portable drivers must specify a pl value that is sufficient
to block out any interrupt handler that might attempt to acquire this lock.
See the description of the min_pl argument on the
for additional discussion and a list of the valid values for pl.
Implementations which do not require that the interrupt priority level be
raised during lock acquisition may choose to ignore this argument.
TRYLOCK may be used to acquire a lock
in a different order from the order defined by the lock
When called from interrupt level,
the pl argument must not specify a priority level below the level at
which the interrupt handler is running.
Context and synchronization
Non-blockable, interrupt, user, or blockable
5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
``Spin locks (DDI)'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005