Show / Hide Table of Contents

# Class ThreadSafety

Helpers for working with thread safety.

##### Inheritance

System.Object
ThreadSafety

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Dalamud.Utility

###### Assembly: Dalamud.dll

##### Syntax

    public static class ThreadSafety

### Properties

| Improve this Doc View Source

#### IsMainThread

Gets a value indicating whether the current thread is the main thread.

##### Declaration

    public static bool IsMainThread { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

### Methods

| Improve this Doc View Source

#### AssertMainThread()

Throws an exception when the current thread is not the main thread.

##### Declaration

    public static void AssertMainThread()

##### Exceptions

Type | Condition
--- | ---
System.InvalidOperationException | Thrown when the current thread is not the main thread.

| Improve this Doc View Source

#### AssertNotMainThread()

Throws an exception when the current thread is the main thread.

##### Declaration

    public static void AssertNotMainThread()

##### Exceptions

Type | Condition
--- | ---
System.InvalidOperationException | Thrown when the current thread is the main thread.