ksync

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 1

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) CountDown

func (that *CountDownLatch) CountDown()

CountDown 减少计数器的值

func (*CountDownLatch) GetCount

func (that *CountDownLatch) GetCount() int

GetCount 获取当前还有多少个任务没完成

func (*CountDownLatch) Wait

func (that *CountDownLatch) Wait()

Wait 阻塞等待,直到计数器归零

func (*CountDownLatch) WaitWithTimeout

func (that *CountDownLatch) WaitWithTimeout(timeout time.Duration) error

WaitWithTimeout 阻塞等待,直到计数器归零或超时

Jump to

Keyboard shortcuts

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