Locks a simple lock.
Item | Description |
---|---|
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:
Item | Description |
---|---|
TRUE | Indicates that the simple lock has been successfully acquired. |
FALSE | Indicates that the simple lock is busy, and has not been acquired. |