bees might be unpaused at any time, so make sure that the dynamic load
calculation is ready with a non-zero thread count.
This avoids a delay of up to 5 seconds when responding to SIGUSR2
when loadavg tracking is enabled.
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
size_t
TaskMasterState::calculate_thread_count_nolock()
{
- if (m_paused) {
- // No threads running while paused or cancelled
- return 0;
- }
-
if (m_load_target == 0) {
// No limits, no stats, use configured thread count
return m_configured_thread_max;