Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

Common.InterlockedAnd

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int InterlockedAnd(ref int location, int value);

Parameters

Parameter Description
location Where to atomically and the result into.
value The value to be combined.

Returns

int The original value in location.

Description

Bitwise and as an atomic operation.

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.

Additional resources: https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.and


Declaration

public static uint InterlockedAnd(ref uint location, uint value);

Parameters

Parameter Description
location Where to atomically and the result into.
value The value to be combined.

Returns

uint The original value in location.

Description

Bitwise and as an atomic operation.

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.

Additional resources: https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.and


Declaration

public static long InterlockedAnd(ref long location, long value);

Parameters

Parameter Description
location Where to atomically and the result into.
value The value to be combined.

Returns

long The original value in location.

Description

Bitwise and as an atomic operation.

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.

Additional resources: https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.and


Declaration

public static ulong InterlockedAnd(ref ulong location, ulong value);

Parameters

Parameter Description
location Where to atomically and the result into.
value The value to be combined.

Returns

ulong The original value in location.

Description

Bitwise and as an atomic operation.

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.

Additional resources: https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.and