leapmotion / autowiring

A C++ Inversion of Control Framework
http://autowiring.io/
Apache License 2.0
149 stars 17 forks source link

Fix more nagging bugs #1035

Closed gittyupagain closed 6 years ago

gittyupagain commented 6 years ago

This PR addresses a few remaining known issues observed in the tests when run repeatedly.

In particular, there were some timing issues with setting the thread priority that could cause the expected thread priority to be lost if set at just the wrong time.

Another issue, that was introduced in #1033, was causing calls to CoreContext::SignalShutdown to potentially wait for a CoreThread to shutdown, even if the wait flag was not set. The solution was to only wait to Rundown (called from the CoreThread's thread) only after the CoreThread::OnStop function is called if we are in the midst of a shutdown.

Finally, some tests were modified to clean up after themselves. Many times there were no waiting on the contexts, causing them to interfere with the next test.