daily update on 20240325 by nitload youmu

This commit is contained in:
YoumuLiu
2024-03-25 09:26:53 +08:00
parent 9a10ec201c
commit 02be081eee
142 changed files with 11277 additions and 572 deletions
@@ -39,6 +39,7 @@ namespace StgSharp
{
public static unsafe partial class StgSharp
{
private static bool _inited;
/// <summary>
+5 -5
View File
@@ -85,11 +85,6 @@ namespace StgSharp
InternalIO.glfwInit();
}
public static void Terminate()
{
MainTimeProvider.Terminate();
}
public static void Mark(bool needConsole)
{
markCount++;
@@ -99,6 +94,11 @@ namespace StgSharp
}
}
public static void Terminate()
{
MainTimeProvider.Terminate();
}
public static void Track(
object target,
string message,
+20 -13
View File
@@ -45,7 +45,7 @@ namespace StgSharp
internal static StgSharpTime mainTimeProvider;
internal static StgSharpTime MainTimeProvider=>mainTimeProvider;
internal static StgSharpTime MainTimeProvider => mainTimeProvider;
}
@@ -92,6 +92,14 @@ namespace StgSharp
timeProvideThread.Start();
}
public void Terminate()
{
lock (mainProvider)
{
mainProvider.Stop();
}
}
protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber)
{
@@ -113,29 +121,28 @@ namespace StgSharp
while (mainProvider.IsRunning)
{
totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L));
if (subscriberList.Count==0)
if (subscriberList.Count == 0)
{
continue;
}
CheckSubscriberSemaphore.Wait();
List<TimeSpanProvider> toRemoveList = new List<TimeSpanProvider>();
foreach (TimeSpanProvider subscriber in subscriberList)
{
if (subscriber.CheckTime(totalMS))
if (!subscriber.CheckTime(totalMS))
{
toRemoveList.Add(subscriber);
};
}
if (toRemoveList.Count != 0)
{
foreach (TimeSpanProvider subscriber in toRemoveList)
{
subscriberList.Remove(subscriber);
}
}
CheckSubscriberSemaphore.Release();
}
int a = 0;
}
public void Terminate()
{
lock (mainProvider)
{
mainProvider.Stop();
}
}
}