Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


InterlockedOr

Bitwise or as an atomic operation.
Read time 2 minutesLast updated 9 days ago

Definition

InterlockedOr(int, int)

Bitwise or as an atomic operation.
public static int InterlockedOr(ref int location, int value)

Parameters

location

Where to atomically or the result into.

value

The value to be combined.

Returns

Type

Description

intThe original value in
location
.

Remarks

Using the return value of this intrinsic may result in worse code-generation on some platforms (a compare-exchange loop), rather than a single atomic instruction being generated.

InterlockedOr(uint, uint)

Bitwise or as an atomic operation.
public static uint InterlockedOr(ref uint location, uint value)

Parameters

location

Where to atomically or the result into.

value

The value to be combined.

Returns

Type

Description

uintThe original value in
location
.

Remarks

Using the return value of this intrinsic may result in worse code-generation on some platforms (a compare-exchange loop), rather than a single atomic instruction being generated.

InterlockedOr(long, long)

Bitwise or as an atomic operation.
public static long InterlockedOr(ref long location, long value)

Parameters

location

Where to atomically or the result into.

value

The value to be combined.

Returns

Type

Description

longThe original value in
location
.

Remarks

Using the return value of this intrinsic may result in worse code-generation on some platforms (a compare-exchange loop), rather than a single atomic instruction being generated.

InterlockedOr(ulong, ulong)

Bitwise or as an atomic operation.
public static ulong InterlockedOr(ref ulong location, ulong value)

Parameters

location

Where to atomically or the result into.

value

The value to be combined.

Returns

Type

Description

ulongThe original value in
location
.

Remarks

Using the return value of this intrinsic may result in worse code-generation on some platforms (a compare-exchange loop), rather than a single atomic instruction being generated.