| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package treapstore | 5 package treapstore |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "strconv" | 9 "strconv" |
| 10 "strings" | 10 "strings" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 go func() { | 253 go func() { |
| 254 doWrite(strconv.Itoa(i)) | 254 doWrite(strconv.Itoa(i)) |
| 255 close(writeDoneC) | 255 close(writeDoneC) |
| 256 }() | 256 }() |
| 257 // The first round has to actually create the Collection
. | 257 // The first round has to actually create the Collection
. |
| 258 go func() { | 258 go func() { |
| 259 readDoneC <- doReads() | 259 readDoneC <- doReads() |
| 260 }() | 260 }() |
| 261 | 261 |
| 262 <-writeDoneC | 262 <-writeDoneC |
| 263 » » » So(<-readDoneC, ShouldBeGreaterThan, 0) | 263 |
| 264 » » » check := ShouldBeGreaterThan |
| 265 » » » if i == 0 { |
| 266 » » » » // The first time around, we *could* read before
anything has been |
| 267 » » » » // written. Every other time, something from the
previous round will |
| 268 » » » » // have been written. |
| 269 » » » » check = ShouldBeGreaterThanOrEqualTo |
| 270 » » » } |
| 271 » » » So(<-readDoneC, check, 0) |
| 264 snaps = append(snaps, head.Snapshot()) | 272 snaps = append(snaps, head.Snapshot()) |
| 265 } | 273 } |
| 266 }) | 274 }) |
| 267 } | 275 } |
| OLD | NEW |