| 387 | } |
| 388 | |
| 389 | void Device::exitTaskingSystem() |
| 390 | { |
| 391 | Lock<MutexSys> lock(g_mutex); |
| 392 | g_num_threads_map.erase(this); |
| 393 | |
| 394 | /* terminate tasking system */ |
| 395 | if (g_num_threads_map.size() == 0) { |
| 396 | TaskScheduler::destroy(); |
| 397 | } |
| 398 | /* or configure new number of threads */ |
| 399 | else { |
| 400 | size_t maxNumThreads = getMaxNumThreads(); |
| 401 | TaskScheduler::create(maxNumThreads,State::set_affinity,State::start_threads); |
| 402 | } |
| 403 | #if USE_TASK_ARENA |
| 404 | arena->arena.reset(); |
| 405 | #endif |
| 406 | } |
| 407 | |
| 408 | void Device::execute(bool join, const std::function<void()>& func) |
| 409 | { |
nothing calls this directly
no test coverage detected