Commit 5f73dd4b authored by marko's avatar marko

Port r983 from branches/zip: Enclose some more debug code in

#ifdef UNIV_SYNC_DEBUG to allow the code to be built
with UNIV_DEBUG but without UNIV_SYNC_DEBUG.
parent d6732ada
...@@ -854,8 +854,10 @@ buf_flush_batch( ...@@ -854,8 +854,10 @@ buf_flush_batch(
ut_ad((flush_type == BUF_FLUSH_LRU) ut_ad((flush_type == BUF_FLUSH_LRU)
|| (flush_type == BUF_FLUSH_LIST)); || (flush_type == BUF_FLUSH_LIST));
#ifdef UNIV_SYNC_DEBUG
ut_ad((flush_type != BUF_FLUSH_LIST) ut_ad((flush_type != BUF_FLUSH_LIST)
|| sync_thread_levels_empty_gen(TRUE)); || sync_thread_levels_empty_gen(TRUE));
#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(buf_pool->mutex)); mutex_enter(&(buf_pool->mutex));
if ((buf_pool->n_flush[flush_type] > 0) if ((buf_pool->n_flush[flush_type] > 0)
......
...@@ -510,8 +510,10 @@ monitoring. */ ...@@ -510,8 +510,10 @@ monitoring. */
extern ulint mutex_system_call_count; extern ulint mutex_system_call_count;
extern ulint mutex_exit_count; extern ulint mutex_exit_count;
#ifdef UNIV_SYNC_DEBUG
/* Latching order checks start when this is set TRUE */ /* Latching order checks start when this is set TRUE */
extern ibool sync_order_checks_on; extern ibool sync_order_checks_on;
#endif /* UNIV_SYNC_DEBUG */
/* This variable is set to TRUE when sync_init is called */ /* This variable is set to TRUE when sync_init is called */
extern ibool sync_initialized; extern ibool sync_initialized;
......
...@@ -1831,7 +1831,9 @@ row_sel( ...@@ -1831,7 +1831,9 @@ row_sel(
mtr_commit(&mtr); mtr_commit(&mtr);
#ifdef UNIV_SYNC_DEBUG
ut_ad(sync_thread_levels_empty_gen(TRUE)); ut_ad(sync_thread_levels_empty_gen(TRUE));
#endif /* UNIV_SYNC_DEBUG */
err = DB_SUCCESS; err = DB_SUCCESS;
goto func_exit; goto func_exit;
...@@ -1850,7 +1852,9 @@ row_sel( ...@@ -1850,7 +1852,9 @@ row_sel(
leaf_contains_updates = FALSE; leaf_contains_updates = FALSE;
mtr_has_extra_clust_latch = FALSE; mtr_has_extra_clust_latch = FALSE;
#ifdef UNIV_SYNC_DEBUG
ut_ad(sync_thread_levels_empty_gen(TRUE)); ut_ad(sync_thread_levels_empty_gen(TRUE));
#endif /* UNIV_SYNC_DEBUG */
goto table_loop; goto table_loop;
...@@ -1866,7 +1870,9 @@ row_sel( ...@@ -1866,7 +1870,9 @@ row_sel(
mtr_commit(&mtr); mtr_commit(&mtr);
#ifdef UNIV_SYNC_DEBUG
ut_ad(sync_thread_levels_empty_gen(TRUE)); ut_ad(sync_thread_levels_empty_gen(TRUE));
#endif /* UNIV_SYNC_DEBUG */
func_exit: func_exit:
if (UNIV_LIKELY_NULL(heap)) { if (UNIV_LIKELY_NULL(heap)) {
......
...@@ -1601,7 +1601,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -1601,7 +1601,7 @@ innobase_start_or_create_for_mysql(void)
srv_was_started = TRUE; srv_was_started = TRUE;
srv_is_being_started = FALSE; srv_is_being_started = FALSE;
#ifdef UNIV_DEBUG #ifdef UNIV_SYNC_DEBUG
/* Wait a while so that the created threads have time to suspend /* Wait a while so that the created threads have time to suspend
themselves before we switch sync debugging on; otherwise a thread may themselves before we switch sync debugging on; otherwise a thread may
execute mutex_enter() before the checks are on, and mutex_exit() after execute mutex_enter() before the checks are on, and mutex_exit() after
...@@ -1609,8 +1609,8 @@ innobase_start_or_create_for_mysql(void) ...@@ -1609,8 +1609,8 @@ innobase_start_or_create_for_mysql(void)
debug. */ debug. */
os_thread_sleep(3000000); os_thread_sleep(3000000);
#endif
sync_order_checks_on = TRUE; sync_order_checks_on = TRUE;
#endif
if (trx_doublewrite == NULL) { if (trx_doublewrite == NULL) {
/* Create the doublewrite buffer to a new tablespace */ /* Create the doublewrite buffer to a new tablespace */
......
...@@ -147,11 +147,10 @@ ut_list_base_node_t mutex_list; ...@@ -147,11 +147,10 @@ ut_list_base_node_t mutex_list;
/* Mutex protecting the mutex_list variable */ /* Mutex protecting the mutex_list variable */
mutex_t mutex_list_mutex; mutex_t mutex_list_mutex;
#ifdef UNIV_SYNC_DEBUG
/* Latching order checks start when this is set TRUE */ /* Latching order checks start when this is set TRUE */
ibool sync_order_checks_on = FALSE; ibool sync_order_checks_on = FALSE;
#endif /* UNIV_SYNC_DEBUG */
/* Dummy mutex used to implement mutex_fence */
mutex_t dummy_mutex_for_fence;
struct sync_thread_struct{ struct sync_thread_struct{
os_thread_id_t id; /* OS thread id */ os_thread_id_t id; /* OS thread id */
......
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