ThreadIndex
Gets the index for the current thread when executing a job, otherwise 0.
Read time 1 minuteLast updated 21 days ago
Definition
- Type: Property
- Namespace: Unity.Jobs.LowLevel.Unsafe
- Assembly: UnityEngine.CoreModule
public static int ThreadIndex { get; }
Remarks
When multiple threads are executing jobs, no two threads have the same index. The range of this property is . The value returned when used from within a job is the same as the value stored in job members decorated with .
[0, Unity.Jobs.LowLevel.Unsafe.JobsUtility.ThreadIndexCount)[Unity.Collections.LowLevel.Unsafe.NativeSetThreadIndexAttribute]ThreadIndexCount