Commit 6d445ad8 authored by Sunny Bains's avatar Sunny Bains

Fix Bug# 58459 - assert slot->in_use == FALSE while starting purge thread.

Fix a race condition in srv_master_thread(). We need to acquire the kernel
mutex before calling srv_table_reserve_slot(). Add a mutex_own() assertion
in srv_table_reserve_slot().
parent 0a96975a
......@@ -831,6 +831,7 @@ srv_table_reserve_slot(
ut_a(type > 0);
ut_a(type <= SRV_MASTER);
ut_ad(mutex_own(&kernel_mutex));
i = 0;
slot = srv_table_get_nth_slot(i);
......@@ -2627,10 +2628,10 @@ srv_master_thread(
srv_main_thread_process_no = os_proc_get_number();
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
srv_table_reserve_slot(SRV_MASTER);
mutex_enter(&kernel_mutex);
srv_table_reserve_slot(SRV_MASTER);
srv_n_threads_active[SRV_MASTER]++;
mutex_exit(&kernel_mutex);
......
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