event: use atomics for *timeout_queue->total since it's updated concurrently, and move TO_QUEUE_*() macros to functions.
event: add/remove from/to the pollset outside of the critical sections.
We don't need external locking since it's created with APR_POLLSET_THREADSAFE, hence reduce those sections to the lowest cycles possible.
A spinlock may be interesting instead of the mutex now, we won't block and the TO_QUEUE_*() and process_timeout_queue() operations are fast...
event: follow up to r1762701: update log tag.
event: avoid unnecessary listener/polling wake ups (context switches) by using apr_pollset_wakeup(), when implemented, to signal the listener according to the next timers or timeout queues expiry (updated at insert and maintenance time).
Follow up to r1762718: CHANGES entry.
event: follow up to r1762718. We still need to kill kept-alive connections in normal/expiry processing if the workers are busy or dying.
event: follow up to r1762718 and r1762742: put de condition where it belongs.
event: follow up to r1762718.
On graceful shutdown/restart, kill kept-alive connections before poll()ing again, avoiding to wait for their "normal" timers (before being woken up) when they remain the last handled connections.
event: follow up to r1762701. Keep QUEUE_APPEND()+pollset_add() or QUEUE_REMOVE()+pollset_remove() atomic.
Otherwise when a worker adds an entry in some queue (e.g. KA, lingering), it might race with the listener in the time between the mutex is released and the pollset is updated; meanwhile the listener might process the queue and find an entry no yet in its pollset.
For the lingering queue, the entry could then have been used after its pool destroyed.
Submitted by: ylavic Reviewed by: ylavic, icing, jim