diff options
author | Matt Joiner <anacrolix@gmail.com> | 2020-10-01 11:10:09 +1000 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2020-10-01 11:10:09 +1000 |
commit | 6efb032b54bd38efa98e6d39021a765d9997857c (patch) | |
tree | e5d92bd55e331a0e5be85dd7121ea30ba872ce9e | |
parent | Tidy up newTx usage and recycle from WouldBlock (diff) | |
download | stm-6efb032b54bd38efa98e6d39021a765d9997857c.tar.gz stm-6efb032b54bd38efa98e6d39021a765d9997857c.tar.xz |
New Tx must have completed=false
This uncovers a race condition where new Tx are already marked completed.
-rw-r--r-- | funcs.go | 1 | ||||
-rw-r--r-- | tx.go | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -35,6 +35,7 @@ func init() { func newTx() *Tx { tx := txPool.Get().(*Tx) tx.tries = 0 + tx.completed = false return tx } @@ -125,7 +125,7 @@ func (tx *Tx) recycle() { delete(tx.watching, v) v.watchers.Delete(tx) } - txPool.Put(tx) + //txPool.Put(tx) } func (tx *Tx) lockAllVars() { |