Access WorkQueue::running only within the cs lock. (#1460)

This removes a race between Interrupt() and Run()
This commit is contained in:
Spencer Lievens 2017-05-05 13:33:26 +02:00 committed by UdjinM6
parent e30faab6fd
commit c4fe229008

View File

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