Merge branch 'master' into develop

This commit is contained in:
AndyPan 2018-09-30 09:44:32 +08:00
commit e8b1147e29
2 changed files with 10 additions and 4 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