Skip to content

Commit

Permalink
fix race
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Sep 21, 2023
1 parent 5fc75a8 commit a2d3f8c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/oras/internal/display/progress/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ func (m *manager) newStatus(id int) Status {
func (m *manager) update(ch chan *status, id int) {
defer m.updating.Done()
for s := range ch {
n := m.statuses[id].Update(s)
m.rwLock.Lock()
m.statuses[id] = n
m.statuses[id] = m.statuses[id].Update(s)
m.rwLock.Unlock()
}
}
Expand Down

0 comments on commit a2d3f8c

Please sign in to comment.