summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/log0log.ic
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2014-09-16 07:37:00 +0300
committerJan Lindström <jplindst@mariadb.org>2014-09-16 07:37:00 +0300
commitec46381990af84e22d1598e6ca84f0647b177f76 (patch)
tree25bb644c970a0b98c4a5c160b46321294b1ebb6b /storage/xtradb/include/log0log.ic
parent8db1f728e626be9f95db524d8a6afefdc3e1edb2 (diff)
downloadmariadb-git-ec46381990af84e22d1598e6ca84f0647b177f76.tar.gz
Avoid using log_sys mutex when printing out show engine innodb status,
instead peek (maybe) old data.
Diffstat (limited to 'storage/xtradb/include/log0log.ic')
-rw-r--r--storage/xtradb/include/log0log.ic19
1 files changed, 17 insertions, 2 deletions
diff --git a/storage/xtradb/include/log0log.ic b/storage/xtradb/include/log0log.ic
index bc076c954ad..853027daa7e 100644
--- a/storage/xtradb/include/log0log.ic
+++ b/storage/xtradb/include/log0log.ic
@@ -553,11 +553,27 @@ log_free_check(void)
#endif /* !UNIV_HOTBACKUP */
/****************************************************************//**
+Unsafely reads the log_sys->tracked_lsn value. Uses atomic operations
+if available, or use dirty read. Use for printing only.
+
+@return log_sys->tracked_lsn value. */
+UNIV_INLINE
+lsn_t
+log_get_tracked_lsn_peek(void)
+/*==========================*/
+{
+#ifdef HAVE_ATOMIC_BUILTINS_64
+ return os_atomic_increment_uint64(&log_sys->tracked_lsn, 0);
+#else
+ return log_sys->tracked_lsn;
+#endif
+}
+
+/****************************************************************//**
Safely reads the log_sys->tracked_lsn value. Uses atomic operations
if available, otherwise this field is protected with the log system
mutex. The writer counterpart function is log_set_tracked_lsn() in
log0online.c.
-
@return log_sys->tracked_lsn value. */
UNIV_INLINE
lsn_t
@@ -571,4 +587,3 @@ log_get_tracked_lsn(void)
return log_sys->tracked_lsn;
#endif
}
-