Bug 54617 - During shutdown: Failing assertion: arr->n_reserved == 0

Get rid of at least on suspicious path. Ensure that the purge thread
doesn't acquire a mutex after it has signalled shutdown.
This commit is contained in:
Sunny Bains 2010-07-22 07:41:51 +10:00
parent 6a8e6ac4c5
commit 043e9e2491

View file

@ -3022,6 +3022,8 @@ srv_purge_thread(
slot_no = srv_table_reserve_slot(SRV_WORKER); slot_no = srv_table_reserve_slot(SRV_WORKER);
slot = srv_table_get_nth_slot(slot_no);
++srv_n_threads_active[SRV_WORKER]; ++srv_n_threads_active[SRV_WORKER];
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
@ -3073,20 +3075,16 @@ srv_purge_thread(
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
ut_ad(srv_table_get_nth_slot(slot_no) == slot);
/* Decrement the active count. */ /* Decrement the active count. */
srv_suspend_thread(); srv_suspend_thread();
mutex_exit(&kernel_mutex); slot->in_use = FALSE;
/* Free the thread local memory. */ /* Free the thread local memory. */
thr_local_free(os_thread_get_curr_id()); thr_local_free(os_thread_get_curr_id());
mutex_enter(&kernel_mutex);
/* Free the slot for reuse. */
slot = srv_table_get_nth_slot(slot_no);
slot->in_use = FALSE;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
#ifdef UNIV_DEBUG_THREAD_CREATION #ifdef UNIV_DEBUG_THREAD_CREATION