diff --git a/src/haproxy.c b/src/haproxy.c index 5d3d92869..d09f15c85 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2740,7 +2740,9 @@ static void *run_thread_poll_loop(void *data) list_for_each_entry(ptaf, &per_thread_alloc_list, list) { if (!ptaf->fct()) { ha_alert("failed to allocate resources for thread %u.\n", tid); +#ifdef USE_THREAD pthread_mutex_unlock(&init_mutex); +#endif exit(1); } } @@ -2752,7 +2754,9 @@ static void *run_thread_poll_loop(void *data) list_for_each_entry(ptif, &per_thread_init_list, list) { if (!ptif->fct()) { ha_alert("failed to initialize thread %u.\n", tid); +#ifdef USE_THREAD pthread_mutex_unlock(&init_mutex); +#endif exit(1); } }