aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stm_test.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/stm_test.go b/stm_test.go
index 527e480..28f56ec 100644
--- a/stm_test.go
+++ b/stm_test.go
@@ -15,12 +15,10 @@ func TestDecrement(t *testing.T) {
}
done := make(chan struct{})
go func() {
- for {
- if AtomicGet(x).(int) == 500 {
- break
- }
- }
- done <- struct{}{}
+ Atomically(func(tx *Tx) {
+ tx.Assert(tx.Get(x) == 500)
+ })
+ close(done)
}()
select {
case <-done: