Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor TestGoPoolWithRetry to use atomic operations #5

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

daniel-hutao
Copy link
Contributor

  • Replaced the increment and read operations on taskRunCount with atomic.AddInt32 and atomic.LoadInt32 respectively in TestGoPoolWithRetry.
  • This change ensures thread-safety when accessing taskRunCount, preventing potential data races.
  • Also made minor formatting adjustments in gopool.go for better code readability.

fix #4

- Replaced the increment and read operations on taskRunCount with atomic.AddInt32 and atomic.LoadInt32 respectively in TestGoPoolWithRetry.
- This change ensures thread-safety when accessing taskRunCount, preventing potential data races.
- Also made minor formatting adjustments in gopool.go for better code readability.

Signed-off-by: Daniel Hu <[email protected]>
@daniel-hutao daniel-hutao merged commit f517701 into main Aug 10, 2023
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.

execute go test -race failed
1 participant