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
Namespace: Unity.Logging.Internal
Syntax
public readonly struct LogControllerScopedLock : IDisposable
Fields
Handle
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
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
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
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 |