NativeSetThreadIndexAttribute
Inject a worker thread index into an int on the job struct.
阅读时间3 分钟最后更新于 1 个月前
Definition
- Type: Class
- Namespace: Unity.Collections.LowLevel.Unsafe
- Assembly: UnityEngine.CoreModule
- Inherits from: Attribute
- Implements: _Attribute
[AttributeUsage(AttributeTargets.Field)]public sealed class NativeSetThreadIndexAttribute : Attribute, _Attribute
Remarks
This is usually used in the implementation of atomic containers. The index is guaranteed to be unique to any other job that might be running in parallel.
Additional Resources: JobsUtility.ThreadIndex