Sign in Join
FPDoc Onlineexperiment

InterlockedExchange function

In unit System

Exchange 2 integers in a thread-safe way.

Declaration

pascal
function InterlockedExchange(var Target: LongInt; Source: LongInt)
: LongInt

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.