summaryrefslogtreecommitdiff
path: root/storage/innobase/include/log0log.ic
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/log0log.ic')
-rw-r--r--storage/innobase/include/log0log.ic20
1 files changed, 20 insertions, 0 deletions
diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.ic
index 67792395ac9..7c79eb96ca9 100644
--- a/storage/innobase/include/log0log.ic
+++ b/storage/innobase/include/log0log.ic
@@ -434,6 +434,26 @@ log_get_flush_lsn(void)
return(lsn);
}
+/************************************************************//**
+Gets the current lsn with a trylock
+@return current lsn or 0 if false*/
+UNIV_INLINE
+lsn_t
+log_get_lsn_nowait(void)
+/*=============*/
+{
+ lsn_t lsn;
+
+ if (mutex_enter_nowait(&(log_sys->mutex)))
+ return 0;
+
+ lsn = log_sys->lsn;
+
+ mutex_exit(&(log_sys->mutex));
+
+ return(lsn);
+}
+
/****************************************************************
Gets the log group capacity. It is OK to read the value without
holding log_sys->mutex because it is constant.