# SetStaticSafetyId

> Assigns the provided static safety ID to an AtomicSafetyHandle. The ID's owner type name and any custom error messages are used by the job debugger when reporting errors involving the target handle.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## SetStaticSafetyId\<T>(AtomicSafetyHandle, int)

Assigns the provided static safety ID to an [AtomicSafetyHandle](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle.md). The ID's owner type name and any custom error messages are used by the job debugger when reporting errors involving the target handle.

```csharp
public static void SetStaticSafetyId<T>(ref AtomicSafetyHandle handle, ref int sharedStaticId)
```

### Parameters

**** (\[AtomicSafetyHandle]\(/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle)): Safety handle.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The static safety ID to associate with the provided handle. This ID must have been allocated with NewStaticSafetyId.

### Remarks

This is preferable to AtomicSafetyHandle.NewStaticSafetyId as it is compatible with burst.

## SetStaticSafetyId(AtomicSafetyHandle, int, FixedString512Bytes)

Assigns the provided static safety ID to an [AtomicSafetyHandle](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle.md). The ID's owner type name and any custom error messages are used by the job debugger when reporting errors involving the target handle.

```csharp
public static void SetStaticSafetyId(ref AtomicSafetyHandle handle, ref int sharedStaticId, FixedString512Bytes name)
```

### Parameters

**** (\[AtomicSafetyHandle]\(/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle)): Safety handle.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The static safety ID to associate with the provided handle. This ID must have been allocated with NewStaticSafetyId.**** (\[FixedString512Bytes]\(/engine/6000.7/script-reference/unity/collections/fixedstring512bytes)): The name of the resource type.

### Remarks

This is preferable to AtomicSafetyHandle.NewStaticSafetyId as it is compatible with burst.
