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;
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.
The lock_alloc kernel service is part of the Base Operating System (BOS) Runtime.
The lock_free kernel service, lock_init kernel service, simple_lock_init kernel service.
Understanding Locking and Locking Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts