Skip to content

InterlockedDecrement

Thread-safe decrement.

Declaration

Source position: systemh.inc line 1640

function InterlockedDecrement(var Target: LongInt) : LongInt;
function InterlockedDecrement(var Target: Pointer) : Pointer;external name 'FPC_INTERLOCKEDDECREMENT64';
function InterlockedDecrement(var Target: Cardinal) : Cardinal;external name 'FPC_INTERLOCKEDDECREMENT';

Description

InterLockedDecrement decrements Target with 1 and returns the result. This is done in a thread-safe way. (i.e. only one processor is accessing the variable at a time).

Errors

None.

See also

Name Description
InterLockedIncrement Thread-safe increment.
InterLockedExchange Exchange 2 integers in a thread-safe way.
InterLockedExchangeAdd Thread-safe add and exchange of 2 values.
InterlockedCompareExchange Conditional exchange.