mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 14:30:17 +00:00
15 lines
347 B
C#
15 lines
347 B
C#
|
using System;
|
|||
|
using System.Threading;
|
|||
|
|
|||
|
namespace SanAndreasUnity.Utilities
|
|||
|
{
|
|||
|
public static class ThreadHelper
|
|||
|
{
|
|||
|
public static void ThrowIfNotOnMainThread()
|
|||
|
{
|
|||
|
if (Thread.CurrentThread.ManagedThreadId != 1)
|
|||
|
throw new Exception("This can only be executed on the main thread");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|