version 4.7.2
PIThreadPoolLoop reworked, now threads starts on constructor and immediately run after start()
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#ifndef PITHREADPOOLLOOP_H
|
||||
#define PITHREADPOOLLOOP_H
|
||||
|
||||
#include "pisemaphore.h"
|
||||
#include "pivector.h"
|
||||
|
||||
class PIThread;
|
||||
@@ -83,7 +84,9 @@ public:
|
||||
private:
|
||||
PIVector<PIThread *> threads;
|
||||
std::function<void(int)> func;
|
||||
std::atomic_int counter = {0};
|
||||
PISemaphore sem_exec, sem_done;
|
||||
std::atomic_bool is_destroy = {false};
|
||||
std::atomic_int counter = {0}, wait_count = {0};
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user