Access WorkQueue::running only within the cs lock.

This removes a "race" between Interrupt() and Run(), though it
should not effect any of our supported platforms.
pull/9679/head
Matt Corallo 8 years ago
parent 1c2edd9f67
commit 7b2d96b634

@ -118,7 +118,7 @@ public:
void Run()
{
ThreadCounter count(*this);
while (running) {
while (true) {
std::unique_ptr<WorkItem> i;
{
std::unique_lock<std::mutex> lock(cs);

Loading…
Cancel
Save