#include "scann/oss_wrappers/scann_threadpool.h"
#include <functional>
#include <memory>
#include "absl/log/check.h"
#include "absl/strings/string_view.h"
namespace research_scann {
ThreadPool::ThreadPool(absl::string_view name, int num_threads) {
eigen_threadpool_ = std::make_unique<Eigen::ThreadPool>(num_threads, true);
}
void ThreadPool::Schedule(std::function<void()> fn) {
CHECK(fn != nullptr);
eigen_threadpool_->Schedule(fn);
}
int ThreadPool::NumThreads() const { return eigen_threadpool_->NumThreads(); }
}