aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-10-03 06:11:13 +0000
committerDean Michael Berris <dberris@google.com>2017-10-03 06:11:13 +0000
commit1dbf45dc2751cadd7c3d0df6b3e19589fc4753f7 (patch)
tree341e304517d39c1c3b161697d3f380f5f942f6e3 /llvm/lib/CodeGen/MachineScheduler.cpp
parent6efe507e4291a6271b27eb052eb9dc5596725421 (diff)
downloadllvm-1dbf45dc2751cadd7c3d0df6b3e19589fc4753f7.zip
llvm-1dbf45dc2751cadd7c3d0df6b3e19589fc4753f7.tar.gz
llvm-1dbf45dc2751cadd7c3d0df6b3e19589fc4753f7.tar.bz2
[XRay][compiler-rt] Use pthread for initializing thread-local data
Summary: We avoid using C++11's thread_local keyword on non-trivially destructible objects because it may introduce deadlocks when the C++ runtime registers destructors calling std::malloc(...). The deadlock may happen when the allocator implementation is itself XRay instrumented. To avoid having to call malloc(...) and free(...) in particular, we use pthread_once, pthread_create_key, and pthread_setspecific to instead manually register the cleanup implementation we want. The code this replaces used an RAII type that implements the cleanup functionality in the destructor, that was then initialized as a function-local thread_local object. While it works in usual situations, unfortunately it breaks when using a malloc implementation that itself is XRay-instrumented. Reviewers: dblaikie, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38073 llvm-svn: 314764
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
0 files changed, 0 insertions, 0 deletions