winnt.h (InterlockedAnd 函式)

在指定的 LONG 值上執行不可部分完成的 AND 作業。

語法

LONG InterlockedAnd(
  [in, out] LONG volatile *Destination,
  [in]      LONG          Value
);

參數

[in, out] Destination

第一個操作數的指標。 此值將會取代為作業的結果。

[in] Value

第二個運算元。

傳回值

函式會傳回 Destination 參數的原始值。

備註

連結函式提供簡單的機制,可同步存取多個線程所共享的變數。 此函式對其他連結函式的呼叫是不可部分完成的。

針對 Intel Itanium 型系統和 x64 架構,此函式是使用編譯程式內部函數來實作。 若為 x86 架構,請直接使用 _InterlockedAnd 編譯程式內建。

此函式會產生完整的記憶體屏障 (或柵欄) ,以確保記憶體作業會依序完成。

Itanium 型系統: 對於效能關鍵性應用程式,請改用 InterlockedAndAcquireInterlockedAndRelease

注意Windows RT 型系統支援此函式。
 

規格需求

需求
目標平台 Windows
標頭 winnt.h (包含 Windows.h)

另請參閱

Interlocked Variable Access

InterlockedAnd16

InterlockedAnd16Acquire

InterlockedAnd16NoFence

InterlockedAnd16Release

InterlockedAnd64

InterlockedAnd64Acquire

InterlockedAnd64NoFence

InterlockedAnd64Release

InterlockedAnd8

InterlockedAnd8Acquire

InterlockedAnd8NoFence

InterlockedAnd8Release

InterlockedAndAcquire

InterlockedAndNoFence

InterlockedAndRelease

同步處理函式