summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/sync0sync.ic
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/include/sync0sync.ic')
-rw-r--r--storage/xtradb/include/sync0sync.ic26
1 files changed, 18 insertions, 8 deletions
diff --git a/storage/xtradb/include/sync0sync.ic b/storage/xtradb/include/sync0sync.ic
index 8176ae55fd8..90789339249 100644
--- a/storage/xtradb/include/sync0sync.ic
+++ b/storage/xtradb/include/sync0sync.ic
@@ -165,7 +165,7 @@ mutex_exit_func(
{
ut_ad(mutex_own(mutex));
- ut_d(mutex->thread_id = (os_thread_id_t) ULINT_UNDEFINED);
+ mutex->thread_id = (os_thread_id_t) ULINT_UNDEFINED;
#ifdef UNIV_SYNC_DEBUG
sync_thread_reset_level(mutex);
@@ -205,7 +205,7 @@ mutex_exit_func(
{
ut_ad(mutex_own(mutex));
- ut_d(mutex->base_mutex.thread_id = (os_thread_id_t) ULINT_UNDEFINED);
+ mutex->base_mutex.thread_id = (os_thread_id_t) ULINT_UNDEFINED;
#ifdef UNIV_SYNC_DEBUG
sync_thread_reset_level(&mutex->base_mutex);
@@ -264,10 +264,15 @@ mutex_enter_func(
the atomic test_and_set; we could peek, and possibly save time. */
if (!ib_mutex_test_and_set(mutex)) {
- ut_d(mutex->thread_id = os_thread_get_curr_id());
+ mutex->thread_id = os_thread_get_curr_id();
#ifdef UNIV_SYNC_DEBUG
mutex_set_debug_info(mutex, file_name, line);
#endif
+ if (srv_instrument_semaphores) {
+ mutex->file_name = file_name;
+ mutex->line = line;
+ }
+
return; /* Succeeded! */
}
@@ -304,10 +309,15 @@ mutex_enter_func(
the atomic test_and_set; we could peek, and possibly save time. */
if (!ib_mutex_test_and_set(&mutex->base_mutex)) {
- ut_d(mutex->base_mutex.thread_id = os_thread_get_curr_id());
+ mutex->base_mutex.thread_id = os_thread_get_curr_id();
#ifdef UNIV_SYNC_DEBUG
mutex_set_debug_info(&mutex->base_mutex, file_name, line);
#endif
+ if(srv_instrument_semaphores) {
+ mutex->base_mutex.file_name = file_name;
+ mutex->base_mutex.line = line;
+ }
+
return; /* Succeeded! */
}
@@ -515,9 +525,9 @@ pfs_mutex_create_func(
# ifdef UNIV_SYNC_DEBUG
ulint level, /*!< in: level */
# endif /* UNIV_SYNC_DEBUG */
+# endif /* UNIV_DEBUG */
const char* cfile_name, /*!< in: file name where created */
ulint cline, /*!< in: file line where created */
-# endif /* UNIV_DEBUG */
const char* cmutex_name) /*!< in: mutex name */
{
mutex->pfs_psi = PSI_MUTEX_CALL(init_mutex)(key, mutex);
@@ -527,9 +537,9 @@ pfs_mutex_create_func(
# ifdef UNIV_SYNC_DEBUG
level,
# endif /* UNIV_SYNC_DEBUG */
+# endif /* UNIV_DEBUG */
cfile_name,
cline,
-# endif /* UNIV_DEBUG */
cmutex_name);
}
@@ -550,11 +560,11 @@ pfs_mutex_create_func(
# ifdef UNIV_SYNC_DEBUG
ulint level, /*!< in: level */
# endif /* UNIV_SYNC_DEBUG */
+# endif /* UNIV_DEBUG */
const char* cfile_name, /*!< in: file name where
created */
ulint cline, /*!< in: file line where
created */
-# endif /* UNIV_DEBUG */
const char* cmutex_name)
{
mutex->base_mutex.pfs_psi = PSI_MUTEX_CALL(init_mutex)(key, mutex);
@@ -564,9 +574,9 @@ pfs_mutex_create_func(
# ifdef UNIV_SYNC_DEBUG
level,
# endif /* UNIV_SYNC_DEBUG */
+# endif /* UNIV_DEBUG */
cfile_name,
cline,
-# endif /* UNIV_DEBUG */
cmutex_name);
}