lock_done Kernel Service

Purpose

Unlocks a complex lock.

Syntax

#include <sys/lock_def.h>

void lock_done ( lock_addr)
complex_lock_t lock_addr;

Parameter

Item Description
lock_addr Specifies the address of the lock word to unlock.

Description

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.