sema

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0, BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

package implements simple semaphore with timeout

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

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

func New

func New() *Lock

func (*Lock) Acquire

func (sem *Lock) Acquire(timeout time.Duration) bool

locks indefinitely if tiemout < 0

func (*Lock) Dispose

func (sem *Lock) Dispose()

must be called otherwise leaks the channel

func (*Lock) Release

func (sem *Lock) Release() bool

Jump to

Keyboard shortcuts

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