This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition resulting from concurrent WaitGroup.Add. (#149)
Generally a WaitGroup should be added to before the goroutine starts. Not doing so can result in a situation where Wait is called before a starting goroutine adds. This is what happened here, causing a race condition. This PR also makes the reveiver variable consistent.
- Loading branch information
Showing
1 changed file
with
78 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters