Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Why do we need SetDoNotWaitForThreads with windows 7 when linking to ITK statically #1028
We are using itk 5.0.0 as a static library on windows, with visual studio 2017. We have encountered some dead locks preventing the unit tests using ITK to terminate. This is only happening on windows 7, not windows 10. It seems that we need to use the method SetDoNotWaitForThreads (86b7cce).
I would like to get more information on the reason of this issue. Why is it only on windows 7 and not windows 10 ? The method SetDoNotWaitForThreads is a temporary work around to an unknown root cause ?
I don't know why would there be a difference between Windows 7 and 10. Are you sure that nothing else is different?
As to why waiting for threads is needed in static case, but not dynamic, it is described in this comment. Essentially, in DLL case the OS has already killed the threads, so trying to wait for them causes a deadlock. Whereas in static case, if we don't wait for threads assertions in debug mode complain about not doing things right - in release mode it does not cause an issue because OS completely cleans up our resources shortly thereafter.