Skip to main content

Class ThreadSafety

Helpers for working with thread safety.

Assembly: Dalamud.dll
Declaration
public static class ThreadSafety

Properties

IsMainThread

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

Declaration
public static bool IsMainThread { get; }

Methods

AssertMainThread(string?)

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

Declaration
public static void AssertMainThread(string? message = null)
Parameters
TypeNameDescription
System.StringmessageThe message to be passed into the exception, if one is to be thrown.
Exceptions

System.InvalidOperationException
Thrown when the current thread is not the main thread.

AssertNotMainThread()

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

Declaration
public static void AssertNotMainThread()
Exceptions

System.InvalidOperationException
Thrown when the current thread is the main thread.

DebugAssertMainThread()

Dalamud.Utility.ThreadSafety.AssertMainThread(string?), but only on debug compilation mode.

Declaration
public static void DebugAssertMainThread()