We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5901e7d commit 39cffd0Copy full SHA for 39cffd0
lld/MachO/Driver.cpp
@@ -313,19 +313,18 @@ class SerialBackgroundQueue {
313
queue.emplace_back(std::move(work));
314
if (!running)
315
running = new std::thread([&]() {
316
- bool shouldPop = false;
317
while (true) {
318
mutex.lock();
319
- if (shouldPop)
320
- queue.pop_front();
321
if (queue.empty()) {
322
mutex.unlock();
323
break;
324
}
325
auto work = std::move(queue.front());
326
- shouldPop = true;
327
328
work();
+ mutex.lock();
+ queue.pop_front();
+ mutex.unlock();
329
330
});
331
0 commit comments