The Interlocked Functions

Ensuring protected access to global integer values turns out to be a common requirement in many applications, so the Windows CE API provides the "interlocked" functions to allow safe incrementing, decrementing, and swapping of values in global integer variables. The functions are

  • InterlockedIncrement— Increment an integer variable. The function takes a single parameter, which is a pointer to the integer to increment.

  • InterlockedDecrement— Decrement an integer variable. The function takes a single parameter, which is a pointer to the integer to increment.

  • InterlockedExchange— Places a new value into an integer variable. The first parameter is a pointer to an integer to receive the new value, and the second parameter is ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.