From eb776ab880765ff3955c5740e14649ed31e247b7 Mon Sep 17 00:00:00 2001 From: Creeper Lv Date: Sat, 19 Feb 2022 02:51:30 +0800 Subject: [PATCH] Added a flag to indicate if Dispatcher is inited. --- CLUNL.Unity3D/Sync/Dispatcher.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CLUNL.Unity3D/Sync/Dispatcher.cs b/CLUNL.Unity3D/Sync/Dispatcher.cs index 4674d47..fabb461 100644 --- a/CLUNL.Unity3D/Sync/Dispatcher.cs +++ b/CLUNL.Unity3D/Sync/Dispatcher.cs @@ -12,6 +12,17 @@ public class Dispatcher //static ImmutableQueue iactions = ImmutableQueue.Empty; static ConcurrentQueue actions = new ConcurrentQueue(); static object _lock = new object(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool Inited() + { + return init; + } + static bool init = false; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MarkInit() + { + init = true; + } /// /// Call to perform a sync operation every frame. ///