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

InterLockedExchange

Exchange 2 integers in a thread-safe way

Declaration

Source position: systemh.inc line 1330

function InterLockedExchange(

  var Target: LongInt;

  Source: LongInt

):LongInt;

function InterLockedExchange(

  var Target: Pointer;

  Source: Pointer

):Pointer;

function InterLockedExchange(

  var Target: Cardinal;

  Source: Cardinal

):Cardinal;

Description

InterLockedExchange stores Source in Target and returns the old value of Target. This is done in a thread-safe way, i.e., only one processor is accessing the Target variable at a time.

Errors

None.

See also

InterLockedDecrement

  

Thread-safe decrement

InterLockedIncrement

  

Thread-safe increment

InterLockedExchangeAdd

  

Thread-safe add and exchange of 2 values

InterlockedCompareExchange

  

Conditional exchange


Documentation generated on: Sep 28 2017