[lld] [llvm] [lld][MachO] Follow-up to use madvise() for threaded file page-in. (PR #157917)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 27 09:44:55 PDT 2025
================
@@ -292,12 +297,13 @@ struct DeferredFile {
using DeferredFiles = std::vector<DeferredFile>;
#if LLVM_ENABLE_THREADS
-class SerialBackgroundQueue {
+class SerialBackgroundWorkQueue {
std::deque<std::function<void()>> queue;
std::thread *running;
std::mutex mutex;
public:
+ bool stopAllWork = false;
----------------
ellishg wrote:
```suggestion
std::atomic_bool stopAllWork = false;
```
I think we need to use atomics to make sure the compiler doesn't optimize away the check
https://github.com/llvm/llvm-project/pull/157917
More information about the llvm-commits
mailing list