PIThreadPoolWorker ready to use

This commit is contained in:
2026-03-25 10:59:32 +03:00
parent 5868e0ec9d
commit a16f629dc5
4 changed files with 106 additions and 64 deletions

View File

@@ -7,4 +7,17 @@ namespace {
DEPRECATEDM("Use pithreadpoolworker.h") const bool deprecated_header_is_used = true;
}
class DEPRECATEDM("Use PIThreadPoolWorker") PIThreadPoolExecutor: public PIThreadPoolWorker {
public:
PIThreadPoolExecutor(int threads_count): PIThreadPoolWorker(threads_count) { start(); }
~PIThreadPoolExecutor() { stopAndWait(); }
void execute(std::function<void()> runnable) DEPRECATEDM("Use enqueueTask()") { enqueueTask(runnable); }
void shutdownNow() DEPRECATEDM("Use stopAndWait()") { stopAndWait(); }
void shutdown() DEPRECATEDM("Use stop()") { stop(); }
bool isShutdown() const DEPRECATEDM("Use !isRunning()") { return !isRunning(); }
bool awaitTermination(PISystemTime timeout) DEPRECATEDM("Use waitForFinish()") { return waitForFinish(timeout); }
};
#endif