aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
authorMatt Joiner <anacrolix@gmail.com>2019-10-31 16:35:43 +1100
committerMatt Joiner <anacrolix@gmail.com>2019-10-31 16:35:43 +1100
commite6b2d4ff0d0d5afaf71ef6df45351909faf7c87b (patch)
treefa264666735c15bc05782a6b4f53ccf545207365 /tx.go
parentPanic when trying to set a nil Var (diff)
parentAdd Tx.Return and a return value from Atomically (diff)
downloadstm-e6b2d4ff0d0d5afaf71ef6df45351909faf7c87b.tar.gz
stm-e6b2d4ff0d0d5afaf71ef6df45351909faf7c87b.tar.xz
Merge branch 'master' into var-conds
* master: Add Tx.Return and a return value from Atomically Panic when trying to set a nil Var # Conflicts: # funcs.go
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/tx.go b/tx.go
index d4f343a..5dd41ae 100644
--- a/tx.go
+++ b/tx.go
@@ -87,3 +87,11 @@ func (tx *Tx) Assert(p bool) {
tx.Retry()
}
}
+
+func (tx *Tx) Return(v interface{}) {
+ panic(_return{v})
+}
+
+type _return struct {
+ value interface{}
+}