#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
