docs.unity3d.com
    Show / Hide Table of Contents

    Struct SpinLockExclusive

    Burst-friendly synchronization primitive

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    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
    IDisposable.Dispose()

    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()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023