version 4.7.2

PIThreadPoolLoop reworked, now threads starts on constructor and immediately run after start()
This commit is contained in:
2025-06-07 10:58:11 +03:00
parent edb077b400
commit e57719c118
3 changed files with 32 additions and 23 deletions

View File

@@ -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};
};