Struct SpinLockExclusive
Burst-friendly synchronization primitive
Inherited Members
Namespace: Unity.Logging
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 readonly bool Locked { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Dispose()
Dispose this spin lock. IDisposable
Declaration
public void Dispose()
Implements
Lock()
Lock. Will block if cannot lock immediately
Declaration
public void Lock()
TryLock(ref Boolean)
Try to lock. Won't block
Declaration
public void TryLock(ref bool lockTaken)
Parameters
Type | Name | Description |
---|---|---|
Boolean | lockTaken | Will be true if lock was taken |
Unlock()
Unlock the spin lock
Declaration
public void Unlock()