disable_lock Kernel Service

Purpose

Raises the interrupt priority, and locks a simple lock if necessary.

Syntax

#include <sys/lock_def.h>

int disable_lock ( int_pri,  lock_addr)
int int_pri;
simple_lock_t lock_addr;

Parameters

Item Description
int_pri Specifies the interrupt priority to set.
lock_addr Specifies the address of the lock word to lock.

Description

The disable_lock kernel service raises the interrupt priority, and locks a simple lock if necessary, in order to provide optimized thread-interrupt critical section protection for the system on which it is executing. On a multiprocessor system, calling the disable_lock kernel service is equivalent to calling the i_disable and simple_lock kernel services. On a uniprocessor system, the call to the simple_lock service is not necessary, and is omitted. However, you should still pass a valid lock address to the disable_lock kernel service. Never pass a NULL lock address.

Execution Environment

The disable_lock kernel service can be called from either the process or interrupt environment.

Return Values

The disable_lock kernel service returns the previous interrupt priority.