Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMutex ¶
type KeyMutex struct {
// contains filtered or unexported fields
}
KeyMutex is an associative mutual exclusion lock. The zero value for a KeyMutex contains unlocked keys.
func (*KeyMutex) Lock ¶
Lock locks a mutex associated with a key.
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore provides counted mutual exclusion. The zero value for a Semaphore is ready for use. A Semaphore must not be copied after first use.
Unlike x/sync/semaphore, it is valid to release tickets after initialization.
func NewSemaphore ¶
New creates a new semaphore with the given count of tickets.
func (*Semaphore) Acquire ¶
func (s *Semaphore) Acquire()
Acquire a ticket, blocking until one is available.
Click to show internal directories.
Click to hide internal directories.