Fixed tests and improve multithread sync

This commit is contained in:
5 changed files with 11 additions and 7 deletions

View File

@@ -21,6 +21,7 @@
#define PIP_TESTS_EXECUTOR_H
#include "piblockingdequeue.h"
#include <atomic>
/**
* @brief Thread pools address two different problems: they usually provide improved performance when executing large
@@ -51,11 +52,11 @@ public:
*/
void shutdown();
volatile bool isShutdown() const;
bool isShutdown() const;
bool awaitTermination(int timeoutMs);
private:
volatile bool isShutdown_;
std::atomic_bool isShutdown_;
PIBlockingDequeue<std::function<void()> >* taskQueue;
PIVector<PIThread*> threadPool;
};