Interlocked.Or Method

Definition

Overloads

Or(Int32, Int32)

Bitwise "ors" two 32-bit signed integers and replaces the first integer with the result, as an atomic operation.

Or(Int64, Int64)

Bitwise "ors" two 64-bit signed integers and replaces the first integer with the result, as an atomic operation.

Or(UInt32, UInt32)

Bitwise "ors" two 32-bit unsigned integers and replaces the first integer with the result, as an atomic operation.

Or(UInt64, UInt64)

Bitwise "ors" two 64-bit unsigned integers and replaces the first integer with the result, as an atomic operation.

Or(Int32, Int32)

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

Bitwise "ors" two 32-bit signed integers and replaces the first integer with the result, as an atomic operation.

C#
public static int Or(ref int location1, int value);

Parameters

location1
Int32

A variable containing the first value to be combined. The result is stored in location1.

value
Int32

The value to be combined with the integer at location1.

Returns

The original value in location1.

Exceptions

The address of location1 is a null pointer.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10

Or(Int64, Int64)

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

Bitwise "ors" two 64-bit signed integers and replaces the first integer with the result, as an atomic operation.

C#
public static long Or(ref long location1, long value);

Parameters

location1
Int64

A variable containing the first value to be combined. The result is stored in location1.

value
Int64

The value to be combined with the integer at location1.

Returns

The original value in location1.

Exceptions

The address of location1 is a null pointer.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10

Or(UInt32, UInt32)

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

Important

This API is not CLS-compliant.

Bitwise "ors" two 32-bit unsigned integers and replaces the first integer with the result, as an atomic operation.

C#
[System.CLSCompliant(false)]
public static uint Or(ref uint location1, uint value);

Parameters

location1
UInt32

A variable containing the first value to be combined. The result is stored in location1.

value
UInt32

The value to be combined with the integer at location1.

Returns

The original value in location1.

Attributes

Exceptions

The address of location1 is a null pointer.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10

Or(UInt64, UInt64)

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

Important

This API is not CLS-compliant.

Bitwise "ors" two 64-bit unsigned integers and replaces the first integer with the result, as an atomic operation.

C#
[System.CLSCompliant(false)]
public static ulong Or(ref ulong location1, ulong value);

Parameters

location1
UInt64

A variable containing the first value to be combined. The result is stored in location1.

value
UInt64

The value to be combined with the integer at location1.

Returns

The original value in location1.

Attributes

Exceptions

The address of location1 is a null pointer.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10