Skip to content

Fix spinner race condition#202

Open
holyfuchs wants to merge 1 commit intomainfrom
holyfuchs/fix-spinner-race
Open

Fix spinner race condition#202
holyfuchs wants to merge 1 commit intomainfrom
holyfuchs/fix-spinner-race

Conversation

@holyfuchs
Copy link
Member

uilive.New() and writer.Flush() both write to a global variable inside the uilive package, which causes data races when multiple spinners run concurrently. This adds a package-level sync.Mutex to serialize those two critical sections. The ticker loop itself is unaffected since it only reads from the writer after initialization.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
output/spinner.go 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants