Version: 2023.2

AtomicSafetyHandle.SetAllowReadOrWriteAccess

切换到手册
public static void SetAllowReadOrWriteAccess (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle, bool allowReadWriteAccess);

参数

handle 安全句柄。
allowReadWriteAccess 使用 false 禁止读取或写入访问,true 与此相反。

描述

允许您阻止对该原子安全句柄的读取或写入访问。

For example when a buffer references other data that becomes invalid, then typically the only operation that can still be performed safely is to dispose of the buffer. Calling this method ensures that any further attempts to read or write the buffer will throw an exception.

Additional resources: AtomicSafetyHandle.GetAllowReadOrWriteAccess.