aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/tx.go b/tx.go
index e90eb57..cdeac0b 100644
--- a/tx.go
+++ b/tx.go
@@ -36,6 +36,9 @@ func (tx *Tx) commit() {
// wait blocks until another transaction modifies any of the Vars read by tx.
func (tx *Tx) wait() {
+ if len(tx.reads) == 0 {
+ panic("not waiting on anything")
+ }
for v := range tx.reads {
v.watchers.Store(tx, nil)
}