Frees the memory of a simple or complex lock.
#include <sys/lock_def.h> #include <sys/lock_alloc.h>
void lock_free (lock_addr) void *lock_addr;
lock_addr | Specifies the address of the lock word whose memory is to be freed. |
The lock_free kernel service frees the memory of a simple or complex lock. The memory freed is the internal operating system memory which was allocated with the lock_alloc kernel service.
Note: It is only necessary to call the lock_free kernel service when the memory that the corresponding lock was protecting is released. For example, if you allocate memory for an i-node which is to be protected by a lock, you must allocate and initialize the lock before using it. The memory may be used with several i-nodes, each taken from, and returned to, the free i-node pool; the lock_init kernel service must be called each time this is done.The lock_free kernel service must be called when the memory allocated for the inode is finally freed.
The lock_free kernel service can be called from the process environment only.
The lock_free kernel service has no return values.
The lock_free kernel service is part of the Base Operating System (BOS) Runtime.
The lock_alloc kernel service.
Understanding Locking and Locking Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts