2
0

Add stress test and fix race it detected

This commit is contained in:
Jack Christensen
2018-12-26 16:30:39 -06:00
parent ba34bdd8ef
commit 33a5f62a2e
2 changed files with 94 additions and 0 deletions
+2
View File
@@ -285,7 +285,9 @@ func (p *Pool) Acquire(ctx context.Context) (*Resource, error) {
select {
case <-ctx.Done():
p.cond.L.Lock()
p.canceledAcquireCount += 1
p.cond.L.Unlock()
// Allow goroutine waiting for signal to exit. Re-signal since we couldn't
// do anything with it. Another goroutine might be waiting.