[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

lock_done Kernel Service


Unlocks a complex lock.


#include <sys/lock_def.h>
void lock_done (lock_addr)
complex_lock_t lock_addr;


lock_addr Specifies the address of the lock word to unlock.


The lock_done kernel services unlocks a complex lock. The calling kernel thread must hold the lock either in shared-read mode or exclusive-write mode. If one or more kernel threads are waiting to acquire the lock in exclusive-write mode, one of these kernel threads (the one with the highest priority) is made runnable and may compete for the lock. Otherwise, any kernel threads which are waiting to acquire the lock in shared-read mode are made runnable. If there was at least one kernel thread waiting for the lock, the priority of the calling kernel thread is recomputed.

If the lock is held recursively, it is not actually released until the lock_done kernel service has been called once for each time that the lock was locked.

Execution Environment

The lock_done kernel service can be called from the process environment only.

Return Values

The lock_done kernel service has no return values.

Implementation Specifics

The lock_done kernel service is part of the Base Operating System (BOS) Runtime.

Related Information

The lock_alloc kernel service, lock_free kernel service, lock_init kernel service.

Understanding Locking and Locking Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts

[ Previous | Next | Contents | Home | Search ]