forked from mirror/ants
format codes
This commit is contained in:
parent
b21f63142d
commit
afba560448
2
pool.go
2
pool.go
|
@ -96,7 +96,7 @@ func NewPool(size, expiry int) (*Pool, error) {
|
||||||
capacity: int32(size),
|
capacity: int32(size),
|
||||||
freeSignal: make(chan sig, math.MaxInt32),
|
freeSignal: make(chan sig, math.MaxInt32),
|
||||||
release: make(chan sig, 1),
|
release: make(chan sig, 1),
|
||||||
expiryDuration: time.Duration(expiry)*time.Second,
|
expiryDuration: time.Duration(expiry) * time.Second,
|
||||||
}
|
}
|
||||||
p.monitorAndClear()
|
p.monitorAndClear()
|
||||||
return p, nil
|
return p, nil
|
||||||
|
|
|
@ -96,7 +96,7 @@ func NewPoolWithFunc(size, expiry int, f pf) (*PoolWithFunc, error) {
|
||||||
capacity: int32(size),
|
capacity: int32(size),
|
||||||
freeSignal: make(chan sig, math.MaxInt32),
|
freeSignal: make(chan sig, math.MaxInt32),
|
||||||
release: make(chan sig, 1),
|
release: make(chan sig, 1),
|
||||||
expiryDuration: time.Duration(expiry)*time.Second,
|
expiryDuration: time.Duration(expiry) * time.Second,
|
||||||
poolFunc: f,
|
poolFunc: f,
|
||||||
}
|
}
|
||||||
p.MonitorAndClear()
|
p.MonitorAndClear()
|
||||||
|
|
Loading…
Reference in New Issue