# InterlockedOr

> Bitwise or as an atomic operation.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Burst.Intrinsics](/engine/6000.6/script-reference/unity/burst/intrinsics.md)
* **Assembly:** UnityEngine.BurstModule

## InterlockedOr(int, int)

Bitwise or as an atomic operation.

```csharp
public static int InterlockedOr(ref int location, int value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Where to atomically or the result into.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The value to be combined.

### Returns

| Type                                                       | Description                       |
| ---------------------------------------------------------- | --------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The 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.

Additional Resources: [](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)[https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)

## InterlockedOr(uint, uint)

Bitwise or as an atomic operation.

```csharp
public static uint InterlockedOr(ref uint location, uint value)
```

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Where to atomically or the result into.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): The value to be combined.

### Returns

| Type                                                         | Description                       |
| ------------------------------------------------------------ | --------------------------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The 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.

Additional Resources: [](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)[https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)

## InterlockedOr(long, long)

Bitwise or as an atomic operation.

```csharp
public static long InterlockedOr(ref long location, long value)
```

### Parameters

**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): Where to atomically or the result into.**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The value to be combined.

### Returns

| Type                                                        | Description                       |
| ----------------------------------------------------------- | --------------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | The 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.

Additional Resources: [](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)[https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)

## InterlockedOr(ulong, ulong)

Bitwise or as an atomic operation.

```csharp
public static ulong InterlockedOr(ref ulong location, ulong value)
```

### Parameters

**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): Where to atomically or the result into.**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): The value to be combined.

### Returns

| Type                                                          | Description                       |
| ------------------------------------------------------------- | --------------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | The 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.

Additional Resources: [](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)[https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.or)
