package
Version:
v0.0.0-...-d3b5644
Opens a new window with list of versions in this module.
Published: Dec 18, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Group 实现了一个计数器,当计数器归零时,等待的函数将被释放。
它是线程安全的,可以在多个goroutine中使用。
NewGroup 创建一个新的CountDownLatch实例,初始化计数器为delta。
func (cdl *Group) CountDown()
CountDown 将计数器减一。当计数器归零时,等待的函数将被释放。
WaitContext 等待计数器归零,同时监听context的取消事件。
如果context被取消,将返回context的错误。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.