aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukechampine <luke.champine@gmail.com>2016-04-02 16:49:41 -0400
committerlukechampine <luke.champine@gmail.com>2016-04-02 17:26:41 -0400
commit56926f9976da7129ac5cdae7f8acf235d068e68e (patch)
treefdf126cad9d67af6a117fa0f6c322b0e0b0009d1
parentuse version in place of simple equality (diff)
downloadstm-56926f9976da7129ac5cdae7f8acf235d068e68e.tar.gz
stm-56926f9976da7129ac5cdae7f8acf235d068e68e.tar.xz
more idiomatic BenchmarkIncrementSTM
-rw-r--r--stm_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/stm_test.go b/stm_test.go
index 06a3238..466f9f9 100644
--- a/stm_test.go
+++ b/stm_test.go
@@ -148,8 +148,9 @@ func BenchmarkIncrementSTM(b *testing.B) {
})
}
// wait for x to reach 1000
- for AtomicGet(x).(int) != 1000 {
- }
+ Atomically(func(tx *Tx) {
+ tx.Assert(tx.Get(x).(int) == 1000)
+ })
}
}