Merge pull request #3537 from ntherning/fix-failing-ThreadTest-tests-on-windows