From 766e04d79d4e77447fc4d15045f6f1e8747bc9e9 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 12 Feb 2018 10:25:06 -0800 Subject: [PATCH] fix crashes on 32bit systems use LoadUint32() instead (#2389) --- cmd/parallel-manager.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/parallel-manager.go b/cmd/parallel-manager.go index a4a1ead1..78f3efc5 100644 --- a/cmd/parallel-manager.go +++ b/cmd/parallel-manager.go @@ -46,7 +46,7 @@ type ParallelManager struct { bandwidthPrev float64 // Current threads number - threadsNum uint64 + threadsNum uint32 // Channel to receive tasks to run queueCh chan func() URLs @@ -59,14 +59,14 @@ type ParallelManager struct { // addWorker creates a new worker to process tasks func (p *ParallelManager) addWorker() { - if atomic.LoadUint64(&p.threadsNum) >= maxParallelWorkers { + if atomic.LoadUint32(&p.threadsNum) >= maxParallelWorkers { // Number of maximum workers is reached, no need to // to create a new one. return } // Update number of threads - atomic.AddUint64(&p.threadsNum, 1) + atomic.AddUint32(&p.threadsNum, 1) // Start a new worker p.wg.Add(1)