1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Add race test for BLPop

This commit is contained in:
Vladimir Mihailenco
2018-03-08 10:16:53 +02:00
parent 9133634a13
commit 11ca0e65c6
3 changed files with 33 additions and 3 deletions

View File

@ -142,7 +142,7 @@ func redisRingOptions() *redis.RingOptions {
}
}
func perform(n int, cbs ...func(int)) {
func performAsync(n int, cbs ...func(int)) *sync.WaitGroup {
var wg sync.WaitGroup
for _, cb := range cbs {
for i := 0; i < n; i++ {
@ -155,6 +155,11 @@ func perform(n int, cbs ...func(int)) {
}(cb, i)
}
}
return &wg
}
func perform(n int, cbs ...func(int)) {
wg := performAsync(n, cbs...)
wg.Wait()
}