Locks a simple lock.
#include <sys/lock_def.h>
void simple_lock ( lock_addr)
simple_lock_t lock_addr;
boolean_t simple_lock_try ( lock_addr)
simple_lock_t lock_addr;
lock_addr | Specifies the address of the lock word to lock. |
The simple_lock kernel service locks the specified lock; it blocks if the lock is busy. The lock must have been previously initialized with the simple_lock_init kernel service. The simple_lock kernel service has no return values.
The simple_lock_try kernel service tries to lock the specified lock; it returns immediately without blocking if the lock is busy. If the lock is free, the simple_lock_try kernel service locks it. The lock must have been previously initialized with the simple_lock_init kernel service.
The simple_lock and simple_lock_try kernel services can be called from the process environment only.
The simple_lock_try kernel service has the following return values:
TRUE | Indicates that the simple lock has been successfully acquired. |
FALSE | Indicates that the simple lock is busy, and has not been acquired. |
The disable_lock kernel service, lock_mine kernel service, simple_lock_init kernel service, simple_unlock kernel service.
Understanding Locking and Locking Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts