Interlocked.And 方法

定义

重载

名称 说明
And(Int32, Int32)

按位“ands”两个 32 位有符号整数,并将第一个整数替换为结果,作为原子操作。

And(Int64, Int64)

按位“ands”两个 64 位有符号整数,并将第一个整数替换为结果,作为原子操作。

And(UInt32, UInt32)

按位“ands”两个 32 位无符号整数,并将第一个整数替换为结果,作为原子操作。

And(UInt64, UInt64)

按位“ands”两个 64 位无符号整数,并将第一个整数替换为结果,作为原子操作。

And<T>(T, T)

And(Int32, Int32)

Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs

按位“ands”两个 32 位有符号整数,并将第一个整数替换为结果,作为原子操作。

public:
 static int And(int % location1, int value);
public static int And(ref int location1, int value);
static member And : int * int -> int
Public Shared Function And (ByRef location1 As Integer, value As Integer) As Integer

参数

location1
Int32

包含要组合的第一个值的变量。 结果存储在 location1.

value
Int32

要与整数组合在一起 location1的值。

返回

中的 location1原始值。

例外

location1地址是指针null

适用于

And(Int64, Int64)

Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs

按位“ands”两个 64 位有符号整数,并将第一个整数替换为结果,作为原子操作。

public:
 static long And(long % location1, long value);
public static long And(ref long location1, long value);
static member And : int64 * int64 -> int64
Public Shared Function And (ByRef location1 As Long, value As Long) As Long

参数

location1
Int64

包含要组合的第一个值的变量。 结果存储在 location1.

value
Int64

要与整数组合在一起 location1的值。

返回

中的 location1原始值。

例外

location1地址是指针null

适用于

And(UInt32, UInt32)

Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs

重要

此 API 不符合 CLS。

按位“ands”两个 32 位无符号整数,并将第一个整数替换为结果,作为原子操作。

public:
 static System::UInt32 And(System::UInt32 % location1, System::UInt32 value);
[System.CLSCompliant(false)]
public static uint And(ref uint location1, uint value);
[<System.CLSCompliant(false)>]
static member And : uint32 * uint32 -> uint32
Public Shared Function And (ByRef location1 As UInteger, value As UInteger) As UInteger

参数

location1
UInt32

包含要组合的第一个值的变量。 结果存储在 location1.

value
UInt32

要与整数组合在一起 location1的值。

返回

中的 location1原始值。

属性

例外

location1地址是指针null

适用于

And(UInt64, UInt64)

Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs

重要

此 API 不符合 CLS。

按位“ands”两个 64 位无符号整数,并将第一个整数替换为结果,作为原子操作。

public:
 static System::UInt64 And(System::UInt64 % location1, System::UInt64 value);
[System.CLSCompliant(false)]
public static ulong And(ref ulong location1, ulong value);
[<System.CLSCompliant(false)>]
static member And : uint64 * uint64 -> uint64
Public Shared Function And (ByRef location1 As ULong, value As ULong) As ULong

参数

location1
UInt64

包含要组合的第一个值的变量。 结果存储在 location1.

value
UInt64

要与整数组合在一起 location1的值。

返回

中的 location1原始值。

属性

例外

location1地址是指针null

适用于

And<T>(T, T)

Source:
Interlocked.cs
public:
generic <typename T>
 where T : value class static T And(T % location1, T value);
public static T And<T>(ref T location1, T value) where T : struct;
static member And : 'T * 'T -> 'T (requires 'T : struct)
Public Shared Function And(Of T As Structure) (ByRef location1 As T, value As T) As T

类型参数

T

参数

location1
T
value
T

返回

T

适用于