g3offrey / semaphore

counting semaphore go package

Home Page:https://pkg.go.dev/github.com/g3offrey/semaphore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

semaphore

semaphore is a Go package, implementing a simple counting semaphore

Installation

go get github.com/g3offrey/semaphore

Usage

import "github.com/g3offrey/semaphore"

func TestSemaphore() {
    sem := semaphore.Make(capacity)

    sem.Acquire()
    // statements ...
    sem.Release()
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

counting semaphore go package

https://pkg.go.dev/github.com/g3offrey/semaphore

License:MIT License


Languages

Language:Go 100.0%