interlocked operation

The thread that performs an interlocked operation on a LONG variable is guaranteed to have exclusive access to the variable until the operation is complete.