PIThreadPoolWorker ready to use
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user