__check_lock_mp, __check_lockd_mp

Purpose

Check Lock on Multiprocessor Systems, Check Lock Doubleword on Multiprocessor Systems

Conditionally updates a single word or doubleword variable atomically.

Prototype

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

unsigned int __check_lockd_mp (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 or 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_mp is valid only in 64-bit mode.