_interlockedbittestandset函式 (winnt.h)

測試指定 LONG 值的指定位,並將其設定為 1。 此作業是不可部分完成的。

語法

BOOLEAN _interlockedbittestandset(
  [in] LONG volatile *Base,
  [in] LONG          Offset
);

參數

[in] Base

變數的指標。

[in] Offset

要測試的位位置。

傳回值

指定之位的值。

備註

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

此函式會盡可能使用編譯程式內部函數來實作。 如需詳細資訊,請參閱 WinBase.h 頭文件及 _interlockedbittestandset

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

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

規格需求

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

另請參閱

Interlocked Variable Access

InterlockedBitTestAndReset

InterlockedBitTestAndReset64

InterlockedBitTestAndResetAcquire

InterlockedBitTestAndResetRelease

InterlockedBitTestAndSet64

InterlockedBitTestAndSetAcquire

InterlockedBitTestAndSetRelease

同步處理函式