| 123 | } |
| 124 | |
| 125 | void ThreadPool::CostSchedule(std::function<void()> fn, int64 cost) { |
| 126 | CHECK(fn != nullptr); |
| 127 | if (cost < 1) { |
| 128 | underlying_threadpool_->Schedule(std::move(fn)); |
| 129 | } else { |
| 130 | underlying_threadpool_->Schedule(std::move(fn), cost); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void ThreadPool::Schedule(std::function<void()> fn) { |
| 135 | CHECK(fn != nullptr); |