aboutsummaryrefslogtreecommitdiff
path: root/global.go
diff options
context:
space:
mode:
authorMatt Joiner <anacrolix@gmail.com>2019-10-23 15:38:09 +1100
committerMatt Joiner <anacrolix@gmail.com>2019-10-23 15:38:09 +1100
commit7655ef3f131d1dfd33e1d0252df1aaaf04e31dc0 (patch)
treef626289c01711474d20b7f11dffcbdb8072f8b7a /global.go
parentPut benchmarks in their own file (diff)
downloadstm-7655ef3f131d1dfd33e1d0252df1aaaf04e31dc0.tar.gz
stm-7655ef3f131d1dfd33e1d0252df1aaaf04e31dc0.tar.xz
Break up the stm.go file
Diffstat (limited to 'global.go')
-rw-r--r--global.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/global.go b/global.go
new file mode 100644
index 0000000..479864e
--- /dev/null
+++ b/global.go
@@ -0,0 +1,8 @@
+package stm
+
+import "sync"
+
+// The globalLock serializes transaction verification/committal. globalCond is
+// used to signal that at least one Var has changed.
+var globalLock sync.Mutex
+var globalCond = sync.NewCond(&globalLock)