waitgroup

package
v1.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WithTimeout

type WithTimeout struct {
	// contains filtered or unexported fields
}

func New

func New() *WithTimeout

新建waitGroup

func (*WithTimeout) Done

func (w *WithTimeout) Done(sn int) *WithTimeout

完成一个

func (*WithTimeout) Init

func (w *WithTimeout) Init(count int) *WithTimeout

重置计数

func (*WithTimeout) Reset

func (w *WithTimeout) Reset(sn int) *WithTimeout

重置计数,返回当前序号

func (*WithTimeout) Wait

func (w *WithTimeout) Wait(ch <-chan interface{}) (count int, isCancel bool)

等待结束,如果收到指定信号则立刻返回

func (*WithTimeout) WaitInfinity

func (w *WithTimeout) WaitInfinity() (count int)

无限等待结束

func (*WithTimeout) WaitWithTimeout

func (w *WithTimeout) WaitWithTimeout(timeout time.Duration) (count int, isTimeout bool)

等待结束,如果超时则立刻返回

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL