From 56926f9976da7129ac5cdae7f8acf235d068e68e Mon Sep 17 00:00:00 2001 From: lukechampine Date: Sat, 2 Apr 2016 16:49:41 -0400 Subject: more idiomatic BenchmarkIncrementSTM --- stm_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'stm_test.go') 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) + }) } } -- cgit v1.2.3