Struct SpinLockExclusive
Burst-friendly synchronization primitive
Implements
Inherited Members
Namespace: Unity.Logging
Assembly: Unity.Logging.dll
Syntax
public struct SpinLockExclusive : IDisposable
Constructors
SpinLockExclusive(Allocator)
Constructor for the spin lock
Declaration
public SpinLockExclusive(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | allocator to use for internal memory allocation. Usually should be Allocator.Persistent |
Properties
Locked
True if locked
Declaration
public bool Locked { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Dispose()
Dispose this spin lock. IDisposable
Declaration
public void Dispose()
Lock()
Lock. Will block if cannot lock immediately
Declaration
public void Lock()
TryLock(ref bool)
Try to lock. Won't block
Declaration
public void TryLock(ref bool lockTaken)
Parameters
Type | Name | Description |
---|---|---|
bool | lockTaken | Will be true if lock was taken |
Unlock()
Unlock the spin lock
Declaration
public void Unlock()