package
Version:
v0.0.0-...-8d22ec3
Opens a new window with list of versions in this module.
Published: Jan 21, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Pool struct {
sync.Mutex
Inuse []interface{}
Available []interface{}
}
对象池
func NewPool(new func() interface{}) *Pool
创建一个新对象池
func (p *Pool) Acquire() interface{}
从池中获取要使用的新池对象。
如果没有可用,则获取创建1个池对象的新实例
func (p *Pool) Release(object interface{})
将对象释放回对象池
Source Files
¶
Click to show internal directories.
Click to hide internal directories.