Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Source/RunActivity/Processes/ProcessState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,11 @@ public void WaitTillFinished()
DebugFileStream.Write("{0},WTF-\n", DateTime.Now.Ticks);
#endif
}

/// <summary>Wait for the specified number of milliseconds, unless termination is signalled.</summary>
public void Sleep(int milliseconds)
{
TerminateEvent.WaitOne(milliseconds);
}
}
}
4 changes: 2 additions & 2 deletions Source/RunActivity/Viewer3D/Processes/HostProcess.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COPYRIGHT 2022 by the Open Rails project.
// COPYRIGHT 2022 by the Open Rails project.
//
// This file is part of Open Rails.
//
Expand Down Expand Up @@ -93,7 +93,7 @@ void HostThread()

while (true)
{
Thread.Sleep(SleepTime);
State.Sleep(SleepTime);
if (State.Terminated)
break;
if (!DoHost())
Expand Down