From 45bc4f51bab554e91a34c731059ee57f76f83610 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Mon, 18 Sep 2023 22:37:02 +0800 Subject: [PATCH] chore: clean up some comments and CI yaml (#296) --- .github/workflows/test.yml | 2 +- pool.go | 8 ++------ pool_func.go | 8 ++------ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27d85c8..33ff07a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/pool.go b/pool.go index bdf3454..2dcf186 100644 --- a/pool.go +++ b/pool.go @@ -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() } @@ -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(), @@ -321,8 +319,6 @@ func (p *Pool) Reboot() { } } -// --------------------------------------------------------------------------- - func (p *Pool) addRunning(delta int) { atomic.AddInt32(&p.running, int32(delta)) } diff --git a/pool_func.go b/pool_func.go index e41ae0e..ce8a0b1 100644 --- a/pool_func.go +++ b/pool_func.go @@ -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() } @@ -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(), @@ -327,8 +325,6 @@ func (p *PoolWithFunc) Reboot() { } } -//--------------------------------------------------------------------------- - func (p *PoolWithFunc) addRunning(delta int) { atomic.AddInt32(&p.running, int32(delta)) }