summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-01-15 20:48:33 +0100
committerunknown <knielsen@knielsen-hq.org>2010-01-15 20:48:33 +0100
commitd9b56c1568c5ff2f355f5f308e11049a2858863e (patch)
tree9d8a2153ecd99c70c232366cdf067c93e1bd189d
parent8bce678408c21d11c34bb78d032a048eebc8089d (diff)
downloadmariadb-git-d9b56c1568c5ff2f355f5f308e11049a2858863e.tar.gz
Fix crashes by taking kernel mutex when calling srv_table_reserve_slot() during thread startup.
-rw-r--r--storage/xtradb/srv/srv0srv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c
index 38176938e62..00352191c2b 100644
--- a/storage/xtradb/srv/srv0srv.c
+++ b/storage/xtradb/srv/srv0srv.c
@@ -2559,10 +2559,9 @@ 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);
@@ -3167,8 +3166,8 @@ srv_purge_thread(
os_thread_pf(os_thread_get_curr_id()));
#endif
- srv_table_reserve_slot(SRV_PURGE);
mutex_enter(&kernel_mutex);
+ srv_table_reserve_slot(SRV_PURGE);
srv_n_threads_active[SRV_PURGE]++;
mutex_exit(&kernel_mutex);
@@ -3255,8 +3254,8 @@ srv_purge_worker_thread(
fprintf(stderr, "Purge worker thread starts, id %lu\n",
os_thread_pf(os_thread_get_curr_id()));
#endif
- srv_table_reserve_slot(SRV_PURGE_WORKER);
mutex_enter(&kernel_mutex);
+ srv_table_reserve_slot(SRV_PURGE_WORKER);
srv_n_threads_active[SRV_PURGE_WORKER]++;
mutex_exit(&kernel_mutex);