diff options
Diffstat (limited to 'include/ctranslate2/thread_pool.h')
-rw-r--r-- | include/ctranslate2/thread_pool.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/include/ctranslate2/thread_pool.h b/include/ctranslate2/thread_pool.h index 1cffb017..826b7e57 100644 --- a/include/ctranslate2/thread_pool.h +++ b/include/ctranslate2/thread_pool.h @@ -3,7 +3,6 @@ #include <atomic> #include <condition_variable> #include <functional> -#include <future> #include <limits> #include <memory> #include <mutex> @@ -26,32 +25,6 @@ namespace ctranslate2 { std::atomic<size_t>* _counter = nullptr; }; - // Job running a function. - template <typename Result> - class FunctionJob : public Job { - public: - FunctionJob(std::function<Result()> func) - : _func(std::move(func)) - { - } - - std::future<Result> get_future() { - return _promise.get_future(); - } - - void run() override { - try { - _promise.set_value(_func()); - } catch (...) { - _promise.set_exception(std::current_exception()); - } - } - - private: - std::function<Result()> _func; - std::promise<Result> _promise; - }; - // A thread-safe queue of jobs. class JobQueue { public: |