INtime SDK Help
InterlockedExchangePointer (iwin32)
INtime SDK v6 > About INtime > Alternate APIs > iwin32 API > iwin32 API > InterlockedExchangePointer (iwin32)

Atomically exchanges a pair of values. The function prevents more than one thread from simultaneously using the same variable.

If you are exchanging pointer values, this function supersedes InterlockedExchange.

PVOID InterlockedExchangePointer(
    PVOID volatile * Target,
    PVOID Value
);

Parameters

Target
Pointer to the pointer to the value to exchange. The function sets the value to Value.
Value
New value for Target.

Remarks

The interlocked functions provide a simple mechanism for synchronizing access to a variable shared by multiple threads. If the variable is in shared memory, threads of different processes can use this mechanism.

Return Values

The initial value pointed to by the Target parameter.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/winbase.h windows.h iwin32.lib

Note

This function operates in the real-time portion of your application.

See Also

InterlockedExchange, iwin32 API, iwin32 Overview