mirror of https://github.com/panjf2000/ants.git
format
This commit is contained in:
parent
e238e0fad0
commit
e8ccc8ecca
4
pool.go
4
pool.go
|
@ -196,10 +196,10 @@ func (p *Pool) getWorker() *Worker {
|
||||||
}
|
}
|
||||||
|
|
||||||
if waiting {
|
if waiting {
|
||||||
for{
|
for {
|
||||||
p.cond.Wait()
|
p.cond.Wait()
|
||||||
l := len(p.workers) - 1
|
l := len(p.workers) - 1
|
||||||
if l < 0{
|
if l < 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
w = p.workers[l]
|
w = p.workers[l]
|
||||||
|
|
|
@ -198,10 +198,10 @@ func (p *PoolWithFunc) getWorker() *WorkerWithFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
if waiting {
|
if waiting {
|
||||||
for{
|
for {
|
||||||
p.cond.Wait()
|
p.cond.Wait()
|
||||||
l := len(p.workers) - 1
|
l := len(p.workers) - 1
|
||||||
if l < 0{
|
if l < 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
w = p.workers[l]
|
w = p.workers[l]
|
||||||
|
|
Loading…
Reference in New Issue