Add missing locks around broadcasts
Signed-off-by: Mark Gordon <msg555@gmail.com>docker-19.03
parent
646fc0af6d
commit
78a8e643f6
|
@ -63,7 +63,9 @@ func (gwf *GatewayForwarder) lookupForwarder(ctx context.Context) (gateway.LLBBr
|
|||
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
gwf.mu.Lock()
|
||||
gwf.updateCond.Broadcast()
|
||||
gwf.mu.Unlock()
|
||||
}()
|
||||
|
||||
gwf.mu.RLock()
|
||||
|
|
|
@ -162,7 +162,9 @@ func (sm *Manager) Get(ctx context.Context, id string) (Caller, error) {
|
|||
go func() {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
sm.mu.Lock()
|
||||
sm.updateCondition.Broadcast()
|
||||
sm.mu.Unlock()
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
|
@ -404,7 +404,9 @@ func (jl *Solver) Get(id string) (*Job, error) {
|
|||
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
jl.mu.Lock()
|
||||
jl.updateCond.Broadcast()
|
||||
jl.mu.Unlock()
|
||||
}()
|
||||
|
||||
jl.mu.RLock()
|
||||
|
|
|
@ -101,7 +101,9 @@ func (pr *progressReader) Read(ctx context.Context) ([]*Progress, error) {
|
|||
select {
|
||||
case <-done:
|
||||
case <-ctx.Done():
|
||||
pr.mu.Lock()
|
||||
pr.cond.Broadcast()
|
||||
pr.mu.Unlock()
|
||||
}
|
||||
}()
|
||||
pr.mu.Lock()
|
||||
|
@ -163,7 +165,9 @@ func pipe() (*progressReader, *progressWriter, func()) {
|
|||
pr.cond = sync.NewCond(&pr.mu)
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
pr.mu.Lock()
|
||||
pr.cond.Broadcast()
|
||||
pr.mu.Unlock()
|
||||
}()
|
||||
pw := &progressWriter{
|
||||
reader: pr,
|
||||
|
|
Loading…
Reference in New Issue