Boost logo

Boost :

From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2020-07-02 13:59:28

On 01/07/2020 21:53, Nikita Kniazev via Boost wrote:
> I am informing release managers that there is a severe bug in Boost.Thread
> that will affect static library users built with MSVC in the next release.
> The bug report: (TLDR:
> thread_specific_ptr data destructor is not called in non-Boost.Thread
> threads)
> I have opened a PR that fixes the issue
>, but got no response in weeks.

That entire part of Boost.Thread relies heavily on implementation
specifics. Basically, it monkey patches the PE header of a DLL to
intercept thread exit notifications to DllMain, and runs TLS cleanup for
that thread.

As of recent MSVCs, they have their own, much better, built-in system
for thread local storage cleanup. You ought to use that instead.

Of course, ideally speaking, Boost.Thread ought to gain understanding of
recent MSVCs, and use the official TLS cleanup mechanism instead of
monkey patching PE headers. I suspect you'll be waiting a long time for
that though, and I recommend you just go ahead and refactor your code to
use C++ 11 thread_local when on VS2017 or later.


Boost list run by bdawes at, gregod at, cpdaniel at, john at