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

package semaphore

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


Package Files


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.

Updated 2018-06-29. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).