Improve the reliability of windows time based actions #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Occasionally in CI, the chrono controller would fail to stop and continue to run even after shutdown had happened.
Looking at the traces it seems that the shutdown from chrono controller stays running forever as well as chrono controller continuing to emit tasks.
The only way this could happen is if shutdown failed to acquire the mutex forever.
By setting running to false first outside of the mutex the main chrono thread should stop emitting tasks if it's looping.
If it's sleeping on the condition variable then locking the mutex then notifying should ensure it wakes up.
Also when windows ran tests, often they would time out.
This was because the timer that was used for sleeping would often vastly overestimate the amount of sleep time.
For example, the sleep for 1ms tests were often sleeping for 15 to 30ms instead.