Merge pull request #1702 from Soreepeong/fix/log-racecon

ConsoleWindow racecon fix and highlight
This commit is contained in:
goat 2024-03-08 22:53:17 +01:00 committed by GitHub
commit 0c70d1c273
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 537 additions and 264 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
using System;
using System.Runtime.CompilerServices;
namespace Dalamud.Utility;
@ -19,6 +20,7 @@ public static class ThreadSafety
/// Throws an exception when the current thread is not the main thread.
/// </summary>
/// <exception cref="InvalidOperationException">Thrown when the current thread is not the main thread.</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void AssertMainThread()
{
if (!threadStaticIsMainThread)
@ -31,6 +33,7 @@ public static class ThreadSafety
/// Throws an exception when the current thread is the main thread.
/// </summary>
/// <exception cref="InvalidOperationException">Thrown when the current thread is the main thread.</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void AssertNotMainThread()
{
if (threadStaticIsMainThread)
@ -39,6 +42,15 @@ public static class ThreadSafety
}
}
/// <summary><see cref="AssertMainThread"/>, but only on debug compilation mode.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void DebugAssertMainThread()
{
#if DEBUG
AssertMainThread();
#endif
}
/// <summary>
/// Marks a thread as the main thread.
/// </summary>