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