Skip to content

Commit c6da7fb

Browse files
dacky1791nf0rmagician
authored andcommitted
Await all jobevents to be processed to stop JobManager.
1 parent 2499fbd commit c6da7fb

File tree

1 file changed

+5
-0
lines changed
  • src/Moryx.ControlSystem.ProcessEngine/Jobs/Implementation

1 file changed

+5
-0
lines changed

src/Moryx.ControlSystem.ProcessEngine/Jobs/Implementation/JobManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public void Start()
7777
public void Stop()
7878
{
7979
_running = false;
80+
// wait until all events are processed
81+
while (_taskQueue.PendingElements > 0)
82+
{
83+
Thread.Sleep(1);
84+
}
8085
}
8186

8287
/// <inheritdoc />

0 commit comments

Comments
 (0)