[fix time]time service now stopps properly
This commit is contained in:
@@ -88,7 +88,7 @@ namespace StgSharp.Timing
|
||||
// mark provider as ended so external users can observe terminal state
|
||||
Volatile.Write(ref _endedFlag, 1);
|
||||
s_unusedID.Push(TokenID);
|
||||
_event.Dispose();
|
||||
_event.Set();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,9 @@ namespace StgSharp.Timing
|
||||
while (true)
|
||||
{
|
||||
int cur = Volatile.Read(ref _pendingSpans);
|
||||
if (cur == 0) {
|
||||
if (cur == 0)
|
||||
{
|
||||
_event.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +209,8 @@ namespace StgSharp.Timing
|
||||
{
|
||||
// mark ended due to sequence timeout, then dispose
|
||||
Volatile.Write(ref _endedFlag, 1);
|
||||
Console.WriteLine("Time span ended.");
|
||||
|
||||
// Console.WriteLine("Time span ended.");
|
||||
Dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user