Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWaitTimeout = errors.New("wait timeout")
定义超时错误
Functions ¶
This section is empty.
Types ¶
type CountDownLatch ¶
type CountDownLatch struct {
// contains filtered or unexported fields
}
func NewCountDownLatch ¶
func NewCountDownLatch(delta int) *CountDownLatch
NewCountDownLatch 初始化一个指定计数的倒计时锁
func (*CountDownLatch) GetCount ¶
func (that *CountDownLatch) GetCount() int
GetCount 获取当前还有多少个任务没完成
func (*CountDownLatch) WaitWithTimeout ¶
func (that *CountDownLatch) WaitWithTimeout(timeout time.Duration) error
WaitWithTimeout 阻塞等待,直到计数器归零或超时
Click to show internal directories.
Click to hide internal directories.