AtomicSafetyHandle is used by the job system to coordinate access to container memory from multiple jobs safely.
You typically do not need to use this type in your code unless you are implementing your own NativeContainer type. For a conceptual overview of AtomicSafetyHandle and the role it plays in the job system, see Implement a custom native container.
CheckDeallocateAndThrow | 检查是否可以取消分配句柄。如果句柄已销毁或当前有任务正在访问数据,则抛出异常。 |
CheckExistsAndThrow | 检查句柄是否仍然有效,如果句柄已销毁,则抛出异常。 |
CheckGetSecondaryDataPointerAndThrow | Check if the data pointer is in a valid state to be aliased by a view on the container which will use the secondary version number. |
CheckReadAndThrow | 检查是否可以读取句柄。如果句柄已销毁或当前有任务正在写入数据,则抛出异常。 |
CheckWriteAndBumpSecondaryVersion | Performs AtomicSafetyHandle.CheckWriteAndThrow and then, assuming that the handle can be written to, bumps the secondary version. |
CheckWriteAndThrow | 检查是否可以写入句柄。如果句柄已销毁或当前有任务正在读取或写入数据,则抛出异常。 |
Create | Creates a new AtomicSafetyHandle. |
EnforceAllBufferJobsHaveCompleted | 等待针对该 AtomicSafetyHandle 运行的所有任务完成。 |
EnforceAllBufferJobsHaveCompletedAndDisableReadWrite | 等待针对该 AtomicSafetyHandle 运行的所有任务完成,然后禁用对该原子安全句柄的读写访问。 |
EnforceAllBufferJobsHaveCompletedAndRelease | 等待针对该 AtomicSafetyHandle 运行的所有任务完成,然后释放该原子安全句柄。 |
GetAllowReadOrWriteAccess | 如果 AtomicSafetyHandle 配置为允许读取或写入,则返回 true。 |
GetNestedContainer | Check whether the given AtomicSafetyHandle represents a nested container, and therefore cannot safely be used in jobs. |
GetReaderArray | 获取读取该安全句柄的所有任务的任务句柄。 |
GetReaderName | 返回指定读取任务的名称。 |
GetTempMemoryHandle | Returns the safety handle which should be used for all temp memory allocations in this temp memory scope. |
GetTempUnsafePtrSliceHandle | 返回单个共享句柄,可以由指向堆栈内存的 NativeSlice 等共享。 |
GetWriter | 返回某个原子安全句柄的写入器(如果有的话)。 |
GetWriterName | 返回某个原子安全句柄的当前写入器的调试名称。 |
IsDefaultValue | Check if the handle still has its default value (i.e. has not yet been initialized by being assigned or passed to AtomicSafetyHandle.Create). |
IsHandleValid | Check if the AtomicSafetyHandle is still valid. |
IsTempMemoryHandle | 检查 AtomicSafetyHandle 是否是当前活动临时内存范围的临时内存安全句柄。 |
IsValidNonDefaultHandle | Check if the handle has been initialized and is currently valid. |
NewStaticSafetyId | Allocates a new static safety ID, to store information for the provided type T. |
PrepareUndisposable | 标记 AtomicSafetyHandle,使其无法被处置。 |
Release | 释放以前创建的 AtomicSafetyHandle。 |
SetAllowReadOrWriteAccess | 允许您阻止对该原子安全句柄的读取或写入访问。 |
SetAllowSecondaryVersionWriting | Set whether handles which use the secondary version number are allowed to write to the container protected by this handle. |
SetBumpSecondaryVersionOnScheduleWrite | Lets you automatically bump the secondary version when scheduling a job that has write access to the atomic safety handle. |
SetCustomErrorMessage | Provide a custom error message for a specific job debugger error type, in cases where additional context can be provided. |
SetNestedContainer | Sets or unsets the nested container flag on an AtomicSafetyHandle. |
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. |
UseSecondaryVersion | 将该 AtomicSafetyHandle 切换为辅助版本号。 |
ValidateNonDefaultHandle | Check that the handle has been initialized, and if so, check that it is still valid. |