Files
pip/libs/main/thread/pithreadpoolexecutor.h
2026-03-25 10:59:32 +03:00

24 lines
874 B
C++

#ifndef PITHREADPOOLEXECUTOR_H
#define PITHREADPOOLEXECUTOR_H
#include "pithreadpoolworker.h"
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