mirror of https://github.com/panjf2000/ants.git
chore: clean up some comments and CI yaml (#296)
This commit is contained in:
parent
aee9c2e2da
commit
45bc4f51ba
|
@ -92,7 +92,7 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ matrix.go }}-go-ci
|
${{ runner.os }}-${{ matrix.go }}-go-ci
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests and integrated tests
|
||||||
run: go test -v -race -coverprofile="codecov.report" -covermode=atomic
|
run: go test -v -race -coverprofile="codecov.report" -covermode=atomic
|
||||||
|
|
||||||
- name: Upload code coverage report to Codecov
|
- name: Upload code coverage report to Codecov
|
||||||
|
|
8
pool.go
8
pool.go
|
@ -106,8 +106,8 @@ func (p *Pool) purgeStaleWorkers(ctx context.Context) {
|
||||||
staleWorkers[i] = nil
|
staleWorkers[i] = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// There might be a situation where all workers have been cleaned up(no worker is running),
|
// There might be a situation where all workers have been cleaned up (no worker is running),
|
||||||
// while some invokers still are stuck in "p.cond.Wait()", then we need to awake those invokers.
|
// while some invokers still are stuck in p.cond.Wait(), then we need to awake those invokers.
|
||||||
if isDormant && p.Waiting() > 0 {
|
if isDormant && p.Waiting() > 0 {
|
||||||
p.cond.Broadcast()
|
p.cond.Broadcast()
|
||||||
}
|
}
|
||||||
|
@ -207,8 +207,6 @@ func NewPool(size int, options ...Option) (*Pool, error) {
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Submit submits a task to this pool.
|
// Submit submits a task to this pool.
|
||||||
//
|
//
|
||||||
// Note that you are allowed to call Pool.Submit() from the current Pool.Submit(),
|
// Note that you are allowed to call Pool.Submit() from the current Pool.Submit(),
|
||||||
|
@ -321,8 +319,6 @@ func (p *Pool) Reboot() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
func (p *Pool) addRunning(delta int) {
|
func (p *Pool) addRunning(delta int) {
|
||||||
atomic.AddInt32(&p.running, int32(delta))
|
atomic.AddInt32(&p.running, int32(delta))
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,8 +107,8 @@ func (p *PoolWithFunc) purgeStaleWorkers(ctx context.Context) {
|
||||||
staleWorkers[i] = nil
|
staleWorkers[i] = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// There might be a situation where all workers have been cleaned up(no worker is running),
|
// There might be a situation where all workers have been cleaned up (no worker is running),
|
||||||
// while some invokers still are stuck in "p.cond.Wait()", then we need to awake those invokers.
|
// while some invokers still are stuck in p.cond.Wait(), then we need to awake those invokers.
|
||||||
if isDormant && p.Waiting() > 0 {
|
if isDormant && p.Waiting() > 0 {
|
||||||
p.cond.Broadcast()
|
p.cond.Broadcast()
|
||||||
}
|
}
|
||||||
|
@ -213,8 +213,6 @@ func NewPoolWithFunc(size int, pf func(interface{}), options ...Option) (*PoolWi
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Invoke submits a task to pool.
|
// Invoke submits a task to pool.
|
||||||
//
|
//
|
||||||
// Note that you are allowed to call Pool.Invoke() from the current Pool.Invoke(),
|
// Note that you are allowed to call Pool.Invoke() from the current Pool.Invoke(),
|
||||||
|
@ -327,8 +325,6 @@ func (p *PoolWithFunc) Reboot() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
func (p *PoolWithFunc) addRunning(delta int) {
|
func (p *PoolWithFunc) addRunning(delta int) {
|
||||||
atomic.AddInt32(&p.running, int32(delta))
|
atomic.AddInt32(&p.running, int32(delta))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue