summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--static_pool.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/static_pool.go b/static_pool.go
index ac9c2529..c7cc6517 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -2,11 +2,12 @@ package roadrunner
import (
"fmt"
- "github.com/pkg/errors"
"os/exec"
"sync"
"sync/atomic"
"time"
+
+ "github.com/pkg/errors"
)
const (
@@ -26,7 +27,7 @@ type StaticPool struct {
factory Factory
// active task executions
- tmu *sync.Mutex
+ tmu sync.Mutex
tasks sync.WaitGroup
// workers circular allocation buf
@@ -36,13 +37,13 @@ type StaticPool struct {
numDead int64
// protects state of worker list, does not affect allocation
- muw *sync.RWMutex
+ muw sync.RWMutex
// all registered workers
workers []*Worker
// invalid declares set of workers to be removed from the pool.
- remove *sync.Map
+ remove sync.Map
// pool is being destroyed
inDestroy int32
@@ -66,9 +67,6 @@ func NewPool(cmd func() *exec.Cmd, factory Factory, cfg Config) (*StaticPool, er
workers: make([]*Worker, 0, cfg.NumWorkers),
free: make(chan *Worker, cfg.NumWorkers),
destroy: make(chan interface{}),
- tmu: &sync.Mutex{},
- remove: &sync.Map{},
- muw: &sync.RWMutex{},
}
// constant number of workers simplify logic