diff options
author | Matt Joiner <anacrolix@gmail.com> | 2020-09-30 19:13:27 +1000 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2020-09-30 19:13:27 +1000 |
commit | a3e788d52494b75b927538c9c2bfee1573aa50e1 (patch) | |
tree | f1eed1cda0c25008c51b375799b9d65a33ce080d /funcs.go | |
parent | Don't sleep and only wake watchers if the variable value has changed (diff) | |
download | stm-a3e788d52494b75b927538c9c2bfee1573aa50e1.tar.gz stm-a3e788d52494b75b927538c9c2bfee1573aa50e1.tar.xz |
Wake watchers until the var changes again
Diffstat (limited to 'funcs.go')
-rw-r--r-- | funcs.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -74,7 +74,7 @@ retry: } // verify the read log tx.lockAllVars() - if !tx.verify() { + if tx.inputsChanged() { tx.unlock() expvars.Add("failed commits", 1) if profileFailedCommits { @@ -84,6 +84,10 @@ retry: } // commit the write log and broadcast that variables have changed tx.commit() + tx.mu.Lock() + tx.completed = true + tx.cond.Broadcast() + tx.mu.Unlock() tx.unlock() expvars.Add("commits", 1) tx.recycle() |