Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is an implementation of weighted semaphore. Uses `golang.org/x/sync/semaphore` under the hood.
func (*Semaphore) Done ¶
func (s *Semaphore) Done()
Done releases the semaphore with a weight of 1.
func (*Semaphore) Exit ¶
func (s *Semaphore) Exit()
Exit calls s.Done() first then calls runtime.Goexit(). If called inside a goroutine, the goroutine will exit immediately. See https://golang.org/pkg/runtime/#Goexit for the documentation.
Click to show internal directories.
Click to hide internal directories.