summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-02 17:31:09 +0300
committerWolfy-J <[email protected]>2019-05-02 17:31:09 +0300
commit34abca68708ed881c3360ee749d794b0000a3aec (patch)
treec7dbb32983a230c5936ab4d0e8ba5c08ff558712 /static_pool.go
parent8fc464213c471ad79be88d9926d8f45b66a23ec0 (diff)
removing workers in runtime
Diffstat (limited to 'static_pool.go')
-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)
}