Skip to content

Commit

Permalink
Merge pull request #153 from kemingy/fix_race
Browse files Browse the repository at this point in the history
fix data race in `Describe`
  • Loading branch information
schollz committed Mar 14, 2023
2 parents d5980c4 + abcd9f5 commit b6e5a4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions progressbar.go
Expand Up @@ -580,6 +580,8 @@ func (p *ProgressBar) Clear() error {
// Describe will change the description shown before the progress, which
// can be changed on the fly (as for a slow running process).
func (p *ProgressBar) Describe(description string) {
p.lock.Lock()
defer p.lock.Unlock()
p.config.description = description
if p.config.invisible {
return
Expand Down

0 comments on commit b6e5a4b

Please sign in to comment.