diff options
Diffstat (limited to 'innobase/thr/thr0loc.c')
-rw-r--r-- | innobase/thr/thr0loc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/innobase/thr/thr0loc.c b/innobase/thr/thr0loc.c index 839cb024f25..a17d09fcca6 100644 --- a/innobase/thr/thr0loc.c +++ b/innobase/thr/thr0loc.c @@ -46,10 +46,11 @@ struct thr_local_struct{ ibool in_ibuf;/* TRUE if the the thread is doing an ibuf operation */ hash_node_t hash; /* hash chain node */ +#ifdef UNIV_DEBUG ulint magic_n; -}; - #define THR_LOCAL_MAGIC_N 1231234 +#endif /* UNIV_DEBUG */ +}; /*********************************************************************** Returns the local storage struct for a thread. */ @@ -64,7 +65,9 @@ thr_local_get( try_again: ut_ad(thr_local_hash); +#ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&thr_local_mutex)); +#endif /* UNIV_SYNC_DEBUG */ /* Look for the local struct in the hash table */ @@ -167,8 +170,9 @@ thr_local_create(void) local->id = os_thread_get_curr_id(); local->handle = os_thread_get_curr(); +#ifdef UNIV_DEBUG local->magic_n = THR_LOCAL_MAGIC_N; - +#endif /* UNIV_DEBUG */ local->in_ibuf = FALSE; mutex_enter(&thr_local_mutex); @@ -207,7 +211,7 @@ thr_local_free( mutex_exit(&thr_local_mutex); - ut_a(local->magic_n == THR_LOCAL_MAGIC_N); + ut_ad(local->magic_n == THR_LOCAL_MAGIC_N); mem_free(local); } |