aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stm.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/stm.go b/stm.go
index 11692f4..f9c09a7 100644
--- a/stm.go
+++ b/stm.go
@@ -219,9 +219,11 @@ retry:
globalLock.Unlock()
goto retry
}
- // commit the write log
- tx.commit()
- globalCond.Broadcast()
+ // commit the write log and broadcast that variables have changed
+ if len(tx.writes) > 0 {
+ tx.commit()
+ globalCond.Broadcast()
+ }
globalLock.Unlock()
}