daily update on 20240325 by nitload youmu
This commit is contained in:
@@ -39,6 +39,7 @@ namespace StgSharp
|
||||
{
|
||||
public static unsafe partial class StgSharp
|
||||
{
|
||||
|
||||
private static bool _inited;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user