Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using atomic instead of mutex and delete scratch slice (#1833)
* using atomic instead of mutex and delete scratch slice * optimize struct * fix default bool * escape data race * avoid the momentary change of wp.workersCount. * removed unused tail (for now) * little fixes * fixed allocations This option immediately exits the loop when the maximum number of vorkers is reached, rather than creating a new vorker if the limit is reached. This reduces the frequency of unnecessary operations and potential locks in sync.Pool * Update for linter workerpool.go Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com> * Update for lint#2 workerpool.go Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com> * Update for lint#3 workerpool.go Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com> * Update for lint#4 workerpool.go * eliminating potential data races --------- Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
- Loading branch information