Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


InterlockedAnd

Bitwise and as an atomic operation.
Read time 2 minutesLast updated 8 days ago

Definition

InterlockedAnd(int, int)

Bitwise and as an atomic operation.
public static int InterlockedAnd(ref int location, int value)

Parameters

location

Where to atomically and 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.

InterlockedAnd(uint, uint)

Bitwise and as an atomic operation.
public static uint InterlockedAnd(ref uint location, uint value)

Parameters

location

Where to atomically and 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.

InterlockedAnd(long, long)

Bitwise and as an atomic operation.
public static long InterlockedAnd(ref long location, long value)

Parameters

location

Where to atomically and 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.

InterlockedAnd(ulong, ulong)

Bitwise and as an atomic operation.
public static ulong InterlockedAnd(ref ulong location, ulong value)

Parameters

location

Where to atomically and 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.