INtime SDK Help
InterlockedIncrement (iwin32)
INtime SDK v7 > About INtime > Alternate APIs > iwin32 API > iwin32 API > InterlockedIncrement (iwin32)

Atomically increments (increases by one) the value of the specified variable and returns the resulting value.

LONG InterlockedIncrement(
    LPLONG volatile lpAddend
);

Parameters

lpAddend
Pointer to the LONG variable to increment.

Remarks

InterlockedIncrement, InterlockedCompareExchange, InterlockedDecrement, InterlockedExchange, and InterlockedExchangeAdd 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.

The variable pointed to by the lpAddend parameter must be aligned on a 32-bit boundary.

Return Values

The resulting incremented value.

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

InterlockedCompareExchange, InterlockedDecrement, InterlockedExchange, InterlockedExchangeAdd iwin32 API, iwin32 Overview