Skip to content

Commit

Permalink
chore: clean up some comments and CI yaml (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Sep 18, 2023
1 parent aee9c2e commit 45bc4f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
restore-keys: |
${{ 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

- name: Upload code coverage report to Codecov
Expand Down
8 changes: 2 additions & 6 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func (p *Pool) purgeStaleWorkers(ctx context.Context) {
staleWorkers[i] = nil
}

// 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.
// 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.
if isDormant && p.Waiting() > 0 {
p.cond.Broadcast()
}
Expand Down Expand Up @@ -207,8 +207,6 @@ func NewPool(size int, options ...Option) (*Pool, error) {
return p, nil
}

// ---------------------------------------------------------------------------

// Submit submits a task to this pool.
//
// Note that you are allowed to call Pool.Submit() from the current Pool.Submit(),
Expand Down Expand Up @@ -321,8 +319,6 @@ func (p *Pool) Reboot() {
}
}

// ---------------------------------------------------------------------------

func (p *Pool) addRunning(delta int) {
atomic.AddInt32(&p.running, int32(delta))
}
Expand Down
8 changes: 2 additions & 6 deletions pool_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func (p *PoolWithFunc) purgeStaleWorkers(ctx context.Context) {
staleWorkers[i] = nil
}

// 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.
// 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.
if isDormant && p.Waiting() > 0 {
p.cond.Broadcast()
}
Expand Down Expand Up @@ -213,8 +213,6 @@ func NewPoolWithFunc(size int, pf func(interface{}), options ...Option) (*PoolWi
return p, nil
}

//---------------------------------------------------------------------------

// Invoke submits a task to pool.
//
// Note that you are allowed to call Pool.Invoke() from the current Pool.Invoke(),
Expand Down Expand Up @@ -327,8 +325,6 @@ func (p *PoolWithFunc) Reboot() {
}
}

//---------------------------------------------------------------------------

func (p *PoolWithFunc) addRunning(delta int) {
atomic.AddInt32(&p.running, int32(delta))
}
Expand Down

0 comments on commit 45bc4f5

Please sign in to comment.