[Lldb-commits] [PATCH] D13940: Fix race conditions in Core/Timer

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 21 10:53:25 PDT 2015


zturner added a comment.

Sad as it may seem, I actually think we may *need* this `LLDB_THREAD_LOCAL` at some point in the future.  The reason is that there is at least one place in LLDB (I think it might even be in `Timer`, but it's been a while since I found this) that relies on thread local destructors.  It is possible to make this work on Windows, but the code is absolutely crazy.  You have to use pragmas to manually inject magic sections into the binary.  Anyway, this actually works using the C++11 `thread_local` keyword under MSVC 2015, so the fact that we don't have those semantics on Windows is currently a bug, and the only way I know of to get them in a sane manner is to use `thread_local`.

Anyway, TL;DR - If you need Thread Local destructors, you can't use `llvm::ThreadLocal`


http://reviews.llvm.org/D13940





More information about the lldb-commits mailing list