core: Index | Files

package semaphore

import ""


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.

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