Allocates system memory for a simple or complex lock.
#include <sys/lock_def.h>
#include <sys/lock_alloc.h>
void lock_alloc ( lock_addr, flags, class, occurrence)
void *lock_addr;
int flags;
short class;
short occurrence;
Item | Description |
---|---|
lock_addr | Specifies a valid simple or complex lock address. |
flags | Specifies whether
the memory allocated is to be pinned or
pageable. Set this parameter as follows:
|
Item | Description |
---|---|
class | Specifies the family which the lock belongs to. |
occurrence | Identifies the instance of the lock within the family. If only one instance of the lock is defined, this parameter should be set to -1. |
The lock_alloc kernel service allocates system memory for a simple or complex lock. The lock_alloc kernel service must be called for each simple or complex before the lock is initialized and used. The memory allocated is for internal lock instrumentation use, and is not returned to the caller; no memory is allocated if instrumentation is not used.
The lock_alloc kernel service can be called from the process environment only.
The lock_alloc kernel service has no return values.