__check_lock_up, __check_lockd_up

Purpose

Check Lock on Uniprocessor Systems, Check Lock Doubleword on Uniprocessor Systems

Conditionally updates a single word or doubleword variable atomically.

Prototype

unsigned int __check_lock_up (const int* addr, int old_value, int new_value);

unsigned int __check_lockd_up (const long* addr, long old_value, long new_value);

Parameters

addr
The address of the variable to be updated. Must be aligned on a 4-byte boundary for a single word and on an 8-byte boundary for a doubleword.
old_value
The old value to be checked against the current value in addr.
new_value
The new value to be conditionally assigned to the variable in addr,

Return value

Returns false (0) if the value in addr was equal to old_value and has been set to the new value. Returns true (1) if the value in addr was not equal to old_value and has been left unchanged.

Usage

__check_lockd_up is valid only in 64-bit mode.