Locks a conventional process lock.
#include <sys/types.h> #include <sys/errno.h> #include <sys/lockl.h>
int lockl (lock_word, flags) lock_t *lock_word; int flags;
lock _word | Specifies the address of the lock word. | ||||||||
flags | Specifies the flags that control waiting for a lock. The flags
parameter is used to control how signals affect waiting for a lock. The four flags are:
Note: The LOCK_SIGRET flag overrides the LOCK_SIGWAKE flag. |
Note: The lockl kernel service is provided for compatibility only and should not be used in new code, which should instead use simple locks or complex locks.
The lockl kernel service locks a conventional lock
The lock word can be located in shared memory. It must be in the process's address space when the lockl or unlockl services are called. The kernel accesses the lock word only while executing under the caller's process.
The lock_word parameter is typically part of the data structure that describes the resource managed by the lock. This parameter must be initialized to the LOCK_AVAIL value before the first call to the lockl service. Only the lockl and unlockl services can alter this parameter while the lock is in use.
The lockl service is nestable. The caller should use the LOCK_SUCC value for determining when to call the unlockl service to unlock the conventional lock.
The lockl service temporarily assigns the owner the process priority of the most favored waiter for the lock.
A process must release all locks before terminating or leaving kernel mode. Signals are not delivered to kernel processes while those processes own any lock. "Understanding System Call Execution" in AIX Kernel Extensions and Device Support Programming Concepts discusses how system calls can use the lockl service when accessing global data.
The lockl kernel service can be called from the process environment only.
The lockl kernel service is part of the Base Operating System (BOS) Runtime.
The unlockl kernel service.
Understanding Locking in AIX Kernel Extensions and Device Support Programming Concepts.
Locking Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts