func (c *concurrencyManager) Close() {
	c.closed = true
}
Close the manager manually
package goccm
import "sync/atomic"
type (
	ConcurrencyManager interface {
		Wait()
		Done()
		Close()
		WaitAllDone()
		RunningCount() int32
	}
	concurrencyManager struct {
		max int
		managerCh chan interface{}
		doneCh chan bool
		allDoneCh chan bool
		closed bool
		runningCount int32
	}
)
func New(maxGoRoutines int) *concurrencyManager {
	c := concurrencyManager{
		max:       maxGoRoutines,
		managerCh: make(chan interface{}, maxGoRoutines),
		doneCh:    make(chan bool),
		allDoneCh: make(chan bool),
	}
	for i := 0; i < c.max; i++ {
		c.managerCh <- nil
	}
	go c.controller()
	return &c
}
func (c *concurrencyManager) controller() {
	for {
		<-c.doneCh
		c.managerCh <- nil
		if c.closed == true && c.runningCount == 0 {
			break
		}
	}
	c.allDoneCh <- true
}
func (c *concurrencyManager) Wait() {
	<-c.managerCh
	atomic.AddInt32(&c.runningCount, 1)
}
func (c *concurrencyManager) Done() {
	atomic.AddInt32(&c.runningCount, -1)
	c.doneCh <- true
}