_InterlockedExchangeAdd (Windows CE 5.0)

Send Feedback

This function performs an atomic addition of an increment value to an addend variable. The function prevents more than one thread from using the same variable simultaneously.

InterlockedExchangeAdd(  PLONG Addend,  LONGIncrement);

Parameters

  • Addend
    [in, out] Value to be incremented.
  • Increment
    [in] Value used to increment Addend.

Return Values

The initial value of the variable pointed to by Addend.

Remarks

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

Requirements

Header: winbase.h.

See Also

Intrinsic Functions for MIPS Microprocessors

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.