STREAMS-UX Programmer's Guide (February 2007)

STREAMS Utilities Supported by HP-UX
Appendix B
183
NAME
LOCK ()Acquire a spinlock.
SYNOPSIS
#include <sys/stream.h>
spl_t LOCK (lock_t *lockptr, spl_t prilev);
PARAMETERS
lockptr
Pointer to lock to be acquired.
prilev
Priority level to be set for the calling interrupt, while it holds the lock. In STREAMS/UX
this parameter is ignored.
DESCRIPTION
LOCK acquires the lock specified by
lockp
. If the lock is not available the caller thread will busy wait until the
lock becomes available.
RETURN VALUES
Returns the current spl level.
CONSTRAINTS
LOCK() can be called from thread or interrupt context. Spinlocks can be held across this call, provided lock
orders are used correctly.