[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

InterLockedIncrement

Thread-safe increment

Declaration

Source position: line 0

function InterLockedIncrement(

  var Target: LongInt

):LongInt;

function InterLockedIncrement(

  var Target: Pointer

):Pointer;

function InterLockedIncrement(

  var Target: Cardinal

):Cardinal;

Description

InterLockedIncrement increments 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

InterLockedDecrement

  

Thread-safe decrement

InterLockedExchange

  

Exchange 2 integers in a thread-safe way

InterLockedExchangeAdd

  

Thread-safe add and exchange of 2 values

InterlockedCompareExchange

  

Conditional exchange

The latest version of this document can be found at lazarus-ccr.sourceforge.net.