mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #1702 from Soreepeong/fix/log-racecon
ConsoleWindow racecon fix and highlight
This commit is contained in:
commit
0c70d1c273
2 changed files with 537 additions and 264 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Dalamud.Utility;
|
namespace Dalamud.Utility;
|
||||||
|
|
||||||
|
|
@ -19,6 +20,7 @@ public static class ThreadSafety
|
||||||
/// Throws an exception when the current thread is not the main thread.
|
/// Throws an exception when the current thread is not the main thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <exception cref="InvalidOperationException">Thrown when the current thread is not the main thread.</exception>
|
/// <exception cref="InvalidOperationException">Thrown when the current thread is not the main thread.</exception>
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static void AssertMainThread()
|
public static void AssertMainThread()
|
||||||
{
|
{
|
||||||
if (!threadStaticIsMainThread)
|
if (!threadStaticIsMainThread)
|
||||||
|
|
@ -31,6 +33,7 @@ public static class ThreadSafety
|
||||||
/// Throws an exception when the current thread is the main thread.
|
/// Throws an exception when the current thread is the main thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <exception cref="InvalidOperationException">Thrown when the current thread is the main thread.</exception>
|
/// <exception cref="InvalidOperationException">Thrown when the current thread is the main thread.</exception>
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static void AssertNotMainThread()
|
public static void AssertNotMainThread()
|
||||||
{
|
{
|
||||||
if (threadStaticIsMainThread)
|
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>
|
/// <summary>
|
||||||
/// Marks a thread as the main thread.
|
/// Marks a thread as the main thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue