An open API service indexing awesome lists of open source software.

https://github.com/f2prateek/semaphore


https://github.com/f2prateek/semaphore

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# semaphore

Provides a semaphore synchronization primitive. A semaphore controls access to a finite number of resources.

# Usage

```go
s := semaphore.New(5)

for {
s.Acquire()
// Only 5 go-routines will run simultaneously.
go func() {
defer s.Release()
}()
}
```