init ensures that the pool is initialized before use. This makes the zero value of the pool usable.
()
| 98 | // init ensures that the pool is initialized before use. This makes the |
| 99 | // zero value of the pool usable. |
| 100 | func (p *Pool) init() { |
| 101 | p.initOnce.Do(func() { |
| 102 | p.tasks = make(chan func()) |
| 103 | }) |
| 104 | } |
| 105 | |
| 106 | // panicIfInitialized will trigger a panic if a configuration method is called |
| 107 | // after the pool has started any goroutines for the first time. In the case that |