Skip to content

Commit

Permalink
fix data race in Describe
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingy94@gmail.com>
  • Loading branch information
kemingy committed Feb 2, 2023
1 parent 17ae25c commit abcd9f5
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 abcd9f5

Please sign in to comment.