共用方式為


CComMultiThreadModelNoCS::Increment

This static function calls the Win32 function InterlockedIncrement, which increments the value of the variable pointed to by p.

static ULONG WINAPI Increment( 
   LPLONG p  
) throw( );

Parameters

  • p
    [in] Pointer to the variable to be incremented.

Return Value

If the result of the increment is 0, then Increment returns 0. If the result of the increment is nonzero, the return value is also nonzero but may not equal the result of the increment.

Remarks

InterlockedIncrement prevents more than one thread from simultaneously using this variable.

Requirements

Header: atlbase.h

See Also

Reference

CComMultiThreadModelNoCS Class

CComMultiThreadModelNoCS::Decrement