| 179 | } |
| 180 | |
| 181 | static void wake_idle_worker(h2_workers *workers, ap_conn_producer_t *prod) |
| 182 | { |
| 183 | if (!APR_RING_EMPTY(&workers->idle, h2_slot, link)) { |
| 184 | h2_slot *slot; |
| 185 | for (slot = APR_RING_FIRST(&workers->idle); |
| 186 | slot != APR_RING_SENTINEL(&workers->idle, h2_slot, link); |
| 187 | slot = APR_RING_NEXT(slot, link)) { |
| 188 | if (slot->is_idle && !slot->should_shutdown) { |
| 189 | apr_thread_cond_signal(slot->more_work); |
| 190 | slot->is_idle = 0; |
| 191 | return; |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | if (workers->dynamic && !workers->shutdown |
| 196 | && (workers->active_slots < workers->max_slots)) { |
| 197 | activate_slot(workers); |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Get the next connection to work on. |
no test coverage detected