issues
search
devchat-ai
/
gopool
GoPool is a high-performance, feature-rich, and easy-to-use worker pool library for Golang.
MIT License
187
stars
26
forks
source link
Refactor TestGoPoolWithRetry to use atomic operations
#5
Closed
daniel-hutao
closed
1 year ago
daniel-hutao
commented
1 year ago
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
fix #4