std::thread increses DLL reference count, which prevents the unloading of the DLL
问题 I have a windows c++ dll which gets loaded by a third party program. I recently added a thread pool (this one https://github.com/progschj/ThreadPool/blob/master/ThreadPool.h). But now the dll get no longer unloaded when the third party program no longer needs it. The reason is that every thread spawned in the thread pool increases the dll reference count by one. One problem is that I don't know when the third party program no longer needs the dll, so I can't manually shutdown the thread pool