| 134 | } |
| 135 | |
| 136 | int ThreadPoolExecutor::initialize(size_t worker_number, |
| 137 | size_t global_capacity) noexcept { |
| 138 | if (!_threads.empty()) { |
| 139 | return -1; |
| 140 | } |
| 141 | _worker_number = worker_number; |
| 142 | _global_capacity = global_capacity; |
| 143 | return start(); |
| 144 | } |
| 145 | |
| 146 | int ThreadPoolExecutor::invoke( |
| 147 | MoveOnlyFunction<void(void)>&& function) noexcept { |