diff options
Diffstat (limited to 'innobase/include/trx0sys.ic')
-rw-r--r-- | innobase/include/trx0sys.ic | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/innobase/include/trx0sys.ic b/innobase/include/trx0sys.ic index 343e6d7c2fa..8f455e554ea 100644 --- a/innobase/include/trx0sys.ic +++ b/innobase/include/trx0sys.ic @@ -60,7 +60,9 @@ trx_sys_get_nth_rseg( trx_sys_t* sys, /* in: trx system */ ulint n) /* in: index of slot */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(n < TRX_SYS_N_RSEGS); return(sys->rseg_array[n]); @@ -98,7 +100,9 @@ trx_sysf_get( header = TRX_SYS + buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, mtr); +#ifdef UNIV_SYNC_DEBUG buf_page_dbg_add_level(header, SYNC_TRX_SYS_HEADER); +#endif /* UNIV_SYNC_DEBUG */ return(header); } @@ -115,7 +119,9 @@ trx_sysf_rseg_get_space( ulint i, /* in: slot index == rseg id */ mtr_t* mtr) /* in: mtr */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(sys_header); ut_ad(i < TRX_SYS_N_RSEGS); @@ -138,7 +144,9 @@ trx_sysf_rseg_get_page_no( mtr_t* mtr) /* in: mtr */ { ut_ad(sys_header); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(i < TRX_SYS_N_RSEGS); return(mtr_read_ulint(sys_header + TRX_SYS_RSEGS @@ -158,7 +166,9 @@ trx_sysf_rseg_set_space( ulint space, /* in: space id */ mtr_t* mtr) /* in: mtr */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(sys_header); ut_ad(i < TRX_SYS_N_RSEGS); @@ -182,7 +192,9 @@ trx_sysf_rseg_set_page_no( slot is reset to unused */ mtr_t* mtr) /* in: mtr */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ ut_ad(sys_header); ut_ad(i < TRX_SYS_N_RSEGS); @@ -236,7 +248,9 @@ trx_get_on_id( { trx_t* trx; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ trx = UT_LIST_GET_FIRST(trx_sys->trx_list); @@ -266,7 +280,9 @@ trx_list_get_min_trx_id(void) { trx_t* trx; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ trx = UT_LIST_GET_LAST(trx_sys->trx_list); @@ -289,7 +305,9 @@ trx_is_active( { trx_t* trx; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(kernel_mutex))); +#endif /* UNIV_SYNC_DEBUG */ if (ut_dulint_cmp(trx_id, trx_list_get_min_trx_id()) < 0) { @@ -325,7 +343,9 @@ trx_sys_get_new_trx_id(void) { dulint id; +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ /* VERY important: after the database is started, max_trx_id value is divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if @@ -355,7 +375,9 @@ trx_sys_get_new_trx_no(void) /*========================*/ /* out: new, allocated trx number */ { +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ return(trx_sys_get_new_trx_id()); } |