-
Notifications
You must be signed in to change notification settings - Fork 903
Closed
Labels
status: fixedThis issue is a now-fixed bug.This issue is a now-fixed bug.
Description
Dear developers:
First, thank you for your checking! The lock pthread_mutex_lock(&init_mutex); is not released if the relevant branch conditions satisfy. The fix is to insert pthread_mutex_unlock(&init_mutex); before exit(1).
Line 2716 in 6a51090
| pthread_mutex_lock(&init_mutex); |
static void *run_thread_poll_loop(void *data)
{
...;
#ifdef USE_THREAD
pthread_mutex_lock(&init_mutex);
#endif
/* The first thread must set the number of threads left */
if (!init_left)
init_left = global.nbthread;
init_left--;
tv_init_thread_date();
list_for_each_entry(ptaf, &per_thread_alloc_list, list) {
if (!ptaf->fct()) {
ha_alert("failed to allocate resources for thread %u.\n", tid);
exit(1); // exit with unreleased lock
}
}
list_for_each_entry(ptif, &per_thread_init_list, list) {
if (!ptif->fct()) {
ha_alert("failed to initialize thread %u.\n", tid);
exit(1); // exit with unreleased lock
}
}
if (init_left == 0)
protocol_enable_all();
#ifdef USE_THREAD
pthread_cond_broadcast(&init_cond);
pthread_mutex_unlock(&init_mutex);
...;
}
Best,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status: fixedThis issue is a now-fixed bug.This issue is a now-fixed bug.