Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiSemaphore ¶
type MultiSemaphore []*Semaphore
MultiSemaphore combines semaphores, making sure to always take and give in the same order (reversed for give). A semaphore may be nil, in which case it is skipped.
func (MultiSemaphore) Give ¶
func (s MultiSemaphore) Give(size int)
func (MultiSemaphore) Take ¶
func (s MultiSemaphore) Take(size int)
func (MultiSemaphore) TakeWithContext ¶
func (s MultiSemaphore) TakeWithContext(ctx context.Context, size int) error
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
func (*Semaphore) SetCapacity ¶
Click to show internal directories.
Click to hide internal directories.