class EE::System::ThreadPool

#include <threadpool.hpp>

class ThreadPool: private EE::NonCopyable {
public:
    // structs

    struct Work;

    // construction

    ThreadPool(Uint32 numThreads, bool terminateOnClose = false);
    virtual ~ThreadPool();

    // methods

    static std::shared_ptr<ThreadPool> createShared(Uint32 numThreads, bool terminateOnClose = false);
    static std::unique_ptr<ThreadPool> createUnique(Uint32 numThreads, bool terminateOnClose = false);
    static ThreadPool* createRaw(Uint32 numThreads, bool terminateOnClose = false);
    Uint64 run(const std::function<void()>& func, const std::function<void(const Uint64&)>& doneCallback = [](const Uint64&) {}, const Uint64& tag = 0);
    Uint32 numThreads() const;
    bool terminateOnClose() const;
    void setTerminateOnClose(bool terminateOnClose);
    bool existsIdInQueue(const Uint64& id);
    bool existsTagInQueue(const Uint64& tag);
    bool removeId(const Uint64& id);
    bool removeWithTag(const Uint64& tag);
};