core: v2ray.com/core/common/signal/semaphore Index | Files

package semaphore

import "v2ray.com/core/common/signal/semaphore"

Index

Package Files

semaphore.go

type Instance Uses

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

Instance is an implementation of semaphore.

func New Uses

func New(n int) *Instance

New create a new Semaphore with n permits.

func (*Instance) Signal Uses

func (s *Instance) Signal()

Signal releases a permit into the semaphore.

func (*Instance) Wait Uses

func (s *Instance) Wait() <-chan struct{}

Wait returns a channel for acquiring a permit.

Package semaphore is imported by 5 packages. Updated 2018-05-27. Refresh now. Tools for package owners.