From 911e6eb6a1a1ab5dd979a1917b79a5465da88181 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 18 十一月 2020 14:33:28 +0800
Subject: [PATCH] 修改gitignore

---
 state.go |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/state.go b/state.go
new file mode 100644
index 0000000..ed4bb8f
--- /dev/null
+++ b/state.go
@@ -0,0 +1,21 @@
+package boltcache
+
+import "sync"
+
+type storeState struct {
+	lastLock sync.Mutex
+	lastLogIndex   uint64
+}
+
+func (s *storeState) getLastLog() (index uint64) {
+	s.lastLock.Lock()
+	index = s.lastLogIndex
+	s.lastLock.Unlock()
+	return
+}
+
+func (s *storeState) setLastLog(index uint64) {
+	s.lastLock.Lock()
+	s.lastLogIndex = index
+	s.lastLock.Unlock()
+}

--
Gitblit v1.8.0