| 97 | } |
| 98 | |
| 99 | void idle_worker_set::set_active(size_t idle_thread) noexcept { |
| 100 | const auto before = m_idle_flags[idle_thread].flag.exchange(status::active, std::memory_order_relaxed); |
| 101 | if (before == status::active) { |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | m_approx_size.fetch_sub(1, std::memory_order_relaxed); |
| 106 | } |
| 107 | |
| 108 | bool idle_worker_set::try_acquire_flag(size_t index) noexcept { |
| 109 | const auto worker_status = m_idle_flags[index].flag.load(std::memory_order_relaxed); |