From a18521271669148081771cbcf48194742d129e68 Mon Sep 17 00:00:00 2001 From: lukechampine Date: Thu, 31 Mar 2016 02:04:31 -0400 Subject: only broadcast when at least one Var changed --- stm.go | 8 +++++--- 1 file 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() } -- cgit v1.2.3