diff --git a/ants.go b/ants.go index 6b3d51c..2e018e8 100644 --- a/ants.go +++ b/ants.go @@ -48,15 +48,6 @@ func init() { } } -// Release Closed the default pool -func Release() { - defaultAntsPool.Release() - defaultAntsPool, err = NewPool(DefaultAntsPoolSize) - if err != nil { - panic(err) - } -} - // Submit submit a task to pool func Submit(task f) error { return defaultAntsPool.Submit(task) @@ -77,6 +68,11 @@ func Free() int { return defaultAntsPool.Free() } +// Release Closed the default pool +func Release() { + defaultAntsPool.Release() +} + // Errors for the Ants API var ( ErrInvalidPoolSize = errors.New("invalid size for pool")