Commit 3993225f authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Initialize nthr_max on startup to avoid a race between

wrk_herder_thread and wrk_herdtimer_thread causing bogus n_wrk_max
stat increments.

Fixes: #1183
parent e1dba877
......@@ -593,6 +593,10 @@ WRK_Init(void)
Lck_New(&herder_mtx, lck_herder);
Lck_New(&wstat_mtx, lck_wstat);
nthr_max = params->wthread_max;
if (nthr_max < params->wthread_min)
nthr_max = params->wthread_min;
wrk_addpools(params->wthread_pools);
AZ(pthread_create(&tp, NULL, wrk_herdtimer_thread, NULL));
AZ(pthread_detach(tp));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment