{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct SpinLockReadWrite | Unity Logging | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SpinLockReadWrite

    Burst-friendly synchronization primitive that supports read lock and exclusive (write) lock

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

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)