Function RWLock.Read

Read ()

Aquire a read lock on the main thread.

Public
ReadLockAsync Read ()

Aquire a read lock on the main thread.

This method will not block until all asynchronous write locks have been released, instead you should make sure to add the returned JobHandle as a dependency to any jobs that use the locked data.

If a synchronous write lock is currently held, this method will throw an exception.

var readLock = AstarPath.active.LockGraphDataForReading();
var handle = new MyJob {
// ...
}.Schedule(readLock.dependency);
readLock.UnlockAfter(handle);