add comments

This commit is contained in:
AndyPan 2018-09-30 09:41:47 +08:00
parent e8ccc8ecca
commit e538683d3f
2 changed files with 6 additions and 0 deletions

View File

@ -52,7 +52,10 @@ type Pool struct {
// lock for synchronous operation. // lock for synchronous operation.
lock sync.Mutex lock sync.Mutex
// cond for waiting idle worker
cond *sync.Cond cond *sync.Cond
once sync.Once once sync.Once
} }

View File

@ -50,7 +50,10 @@ type PoolWithFunc struct {
// lock for synchronous operation. // lock for synchronous operation.
lock sync.Mutex lock sync.Mutex
// cond for waiting idle worker
cond *sync.Cond cond *sync.Cond
// pf is the function for processing tasks. // pf is the function for processing tasks.
poolFunc pf poolFunc pf