| 247 | } |
| 248 | |
| 249 | void NPar::TLocalExecutor::Exec(TIntrusivePtr<ILocallyExecutable> exec, int id, int flags) { |
| 250 | Y_ASSERT((flags & WAIT_COMPLETE) == 0); // unsupported |
| 251 | int prior = Max<int>(Impl_->CurrentTaskPriority, flags & PRIORITY_MASK); |
| 252 | switch (prior) { |
| 253 | case HIGH_PRIORITY: |
| 254 | ++Impl_->QueueSize; |
| 255 | Impl_->JobQueue.Enqueue(TSingleJob(std::move(exec), id)); |
| 256 | break; |
| 257 | case MED_PRIORITY: |
| 258 | ++Impl_->MPQueueSize; |
| 259 | Impl_->MedJobQueue.Enqueue(TSingleJob(std::move(exec), id)); |
| 260 | break; |
| 261 | case LOW_PRIORITY: |
| 262 | ++Impl_->LPQueueSize; |
| 263 | Impl_->LowJobQueue.Enqueue(TSingleJob(std::move(exec), id)); |
| 264 | break; |
| 265 | default: |
| 266 | Y_ASSERT(0); |
| 267 | break; |
| 268 | } |
| 269 | Impl_->HasJob.Signal(); |
| 270 | } |
| 271 | |
| 272 | void NPar::ILocalExecutor::Exec(TLocallyExecutableFunction exec, int id, int flags) { |
| 273 | Exec(new TFunctionWrapper(std::move(exec)), id, flags); |
nothing calls this directly
no test coverage detected