Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sema ¶
type Sema struct {
// contains filtered or unexported fields
}
Sema provides a simple semaphore implementation
func (*Sema) Acquire ¶
func (s *Sema) Acquire()
Acquire the semaphore, will block if semaphore is full until any other holder release it.
func (*Sema) AcquireWithin ¶
AcquireWithin the given timeout return true on success and false on failure
func (*Sema) Release ¶
func (s *Sema) Release()
Release the semaphore allowing waking waiters if any to acquire.
func (*Sema) TryAcquire ¶
TryAcquire the semaphore without blocking return true on success and false on failure.
Click to show internal directories.
Click to hide internal directories.