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 |
---|---|
Spin |
Allocates the spinlock |
Properties
Name | Description |
---|---|
Is |
True if was created |
Locked | True if exclusively locked |
Locked |
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 |
Lock |
Enters the read lock (multiple read locks allowed in parallel, but no exclusive) |
Must |
Throws if not in the exclusive lock |
Must |
Throws if not in the read lock |
Unlock() | Exits the exclusive lock |
Unlock |
Exits the read lock |