summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--static_pool.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/static_pool.go b/static_pool.go
index 54e0caac..c88548ed 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -195,6 +195,8 @@ func (p *StaticPool) allocateWorker() (w *Worker, err error) {
if remove, err := p.removeWorker(w); remove {
i++
+ atomic.AddInt64(&p.numDead, 1)
+
w.markDestroying()
go p.destroyWorker(w, err)
}
@@ -220,6 +222,8 @@ func (p *StaticPool) allocateWorker() (w *Worker, err error) {
if remove, err := p.removeWorker(w); remove {
i++
+ atomic.AddInt64(&p.numDead, 1)
+
w.markDestroying()
go p.destroyWorker(w, err)
}