docs.unity3d.com
    Show / Hide Table of Contents

    Struct LogControllerScopedLock

    Lock that controls any Unity.Logging.Internal.LogControllerWrapper changes. This ensures that LogController and its LogMemoryManager are valid during the lock

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Logging.Internal
    Syntax
    public readonly struct LogControllerScopedLock : IDisposable

    Fields

    Handle

    LoggerHandle of the lock's LogController
    Declaration
    public readonly LoggerHandle Handle
    Field Value
    Type Description
    LoggerHandle

    Properties

    IsValid

    True if lock has a valid LoggerHandle, means it is connected to some Logger

    Declaration
    public readonly bool IsValid { get; }
    Property Value
    Type Description
    Boolean

    OwnsLock

    True if this lock owns the lock operation and is responsible for the unlocking in Dispose() CreateAlreadyUnderLock(LoggerHandle)

    Declaration
    public readonly bool OwnsLock { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Create()

    Creates LogControllerScopedLock for the current CurrentLoggerHandle logger. Owns the lock operation

    Declaration
    public static LogControllerScopedLock Create()
    Returns
    Type Description
    LogControllerScopedLock

    Created LogControllerScopedLock

    Create(LoggerHandle)

    Creates LogControllerScopedLock for the logger with . Owns the lock operation

    Declaration
    public static LogControllerScopedLock Create(LoggerHandle loggerHandle)
    Parameters
    Type Name Description
    LoggerHandle loggerHandle

    LoggerHandle of the logger to create a lock on

    Returns
    Type Description
    LogControllerScopedLock

    Created LogControllerScopedLock

    CreateAlreadyUnderLock(LoggerHandle)

    Creates LogControllerScopedLock for the logger with . But doesn't own the lock operation. Used in situations when lock is already taken OwnsLock

    Declaration
    public static LogControllerScopedLock CreateAlreadyUnderLock(LoggerHandle loggerHandle)
    Parameters
    Type Name Description
    LoggerHandle loggerHandle

    LoggerHandle of the logger

    Returns
    Type Description
    LogControllerScopedLock

    Created LogControllerScopedLock with OwnsLock == false

    Dispose()

    If owns the lock - unlock OwnsLock

    Declaration
    public readonly void Dispose()
    Implements
    IDisposable.Dispose()

    GetLogController()

    Returns LogController that is safe to use

    Declaration
    public readonly ref LogController GetLogController()
    Returns
    Type Description
    LogController

    Ref to LogController of this lock

    MustBeValid()

    Throws if this lock is not valid. IsValid

    Declaration
    [Conditional("DEBUG_ADDITIONAL_CHECKS")]
    public readonly void MustBeValid()
    Exceptions
    Type Condition
    Exception

    throws if this lock is not valid

    Back to top
    Terms of use
    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