llvm-project
9487cf97 - [Support] Restrict ManagedStatic ThreadPoolExecutor to Windows

Commit
1 year ago
[Support] Restrict ManagedStatic ThreadPoolExecutor to Windows https://reviews.llvm.org/D70447 switched to `ManagedStatic` to work around race conditions in MSVC runtimes and the MinGW runtime. However, `ManagedStatic` is not suitable for other platforms. However, this workaround is not suitable for other platforms (#66974). lld::fatal calls exitLld(1), which calls `llvm_shutdown` to destroy `ManagedStatic` objects. The worker threads will finish and invoke TLS destructors (glibc `__call_tls_dtors`). This can lead to race conditions if other threads attempt to access TLS objects that have already been destroyed. While lld's early exit mechanism needs more work, I believe Parallel.cpp should avoid this pitfall as well. Pull Request: https://github.com/llvm/llvm-project/pull/102989
Author
Parents
Loading