[libcxx-commits] [PATCH] D155278: [libc++][mingw] TLS cleanup on windows

Karl-Johan Johnsson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 10 23:37:55 PDT 2023


kalle-llvm added a comment.

In D155278#4577921 <https://reviews.llvm.org/D155278#4577921>, @mstorsjo wrote:

> The thread local destructors do run at roughly the right time when they're supposed to, both when threads exit and when a DLL is unloaded. I guess there's a potential concern that there's no ordering between this thread local destructor and other thread local destructors. So I guess that'd mean that other thread local destructors can't use exception handling within their call stack, if they run after this particular dtor, as there's nothing to force their internal ordering - or is there?

That's exactly what I thought at first, but then I realized that `eh_globals` is just a plain struct with no destructor.  And it is not allocated with new it just lives in the thread_local memory block, so there should be no lifetime issues.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155278/new/

https://reviews.llvm.org/D155278



More information about the libcxx-commits mailing list