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

lock_free Kernel Service

Purpose

Frees the memory of a simple or complex lock.

Syntax

#include <sys/lock_def.h>
#include <sys/lock_alloc.h>
void lock_free (lock_addr)
void *lock_addr;

Parameter

lock_addr Specifies the address of the lock word whose memory is to be freed.

Description

The lock_free kernel service frees the memory of a simple or complex lock. The memory freed is the internal operating system memory which was allocated with the lock_alloc kernel service.

Note: It is only necessary to call the lock_free kernel service when the memory that the corresponding lock was protecting is released. For example, if you allocate memory for an i-node which is to be protected by a lock, you must allocate and initialize the lock before using it. The memory may be used with several i-nodes, each taken from, and returned to, the free i-node pool; the lock_init kernel service must be called each time this is done.The lock_free kernel service must be called when the memory allocated for the inode is finally freed.

Execution Environment

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

Return Values

The lock_free kernel service has no return values.

Implementation Specifics

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

Related Information

The lock_alloc kernel service.

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


[ Previous | Next | Contents | Home | Search ]