Struct SpinLockReadWrite
Burst-friendly synchronization primitive that supports read lock and exclusive (write) lock
Implements
Inherited Members
Namespace: Unity.Logging
Assembly: solution.dll
Syntax
public struct SpinLockReadWrite : IDisposable
Constructors
| Name | Description |
|---|---|
| SpinLockReadWrite(Allocator) | Allocates the spinlock |
Properties
| Name | Description |
|---|---|
| IsCreated | True if was created |
| Locked | True if exclusively locked |
| LockedForRead | True if read locked |
Methods
| Name | Description |
|---|---|
| Dispose() | Enters the exclusive mode (so no other is holding the lock) and destroys it - so nobody can enter it |
| Lock() | Enters the exclusive lock |
| LockRead() | Enters the read lock (multiple read locks allowed in parallel, but no exclusive) |
| MustBeExclusivelyLocked() | Throws if not in the exclusive lock |
| MustBeReadLocked() | Throws if not in the read lock |
| Unlock() | Exits the exclusive lock |
| UnlockRead() | Exits the read lock |