Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RWMutex ¶
type RWMutex interface { Mutex RLock() RUnlock() }
func NewRWMutex ¶
func NewRWMutex() RWMutex
type TimeoutCond ¶
TimeoutCond is a variant on Cond. It has roughly the same semantics regarding 'L' - it must be held both when broadcasting and when calling TimeoutCondWaiter.Wait() Call Broadcast() to broadcast to all waiters on the TimeoutCond. Call SetupWait to create a TimeoutCondWaiter configured with the given timeout, which can then be used to listen for broadcasts.
func NewTimeoutCond ¶
func NewTimeoutCond(l sync.Locker) *TimeoutCond
func (*TimeoutCond) Broadcast ¶
func (c *TimeoutCond) Broadcast()
func (*TimeoutCond) SetupWait ¶
func (c *TimeoutCond) SetupWait(timeout time.Duration) *TimeoutCondWaiter
type TimeoutCondWaiter ¶
type TimeoutCondWaiter struct {
// contains filtered or unexported fields
}
TimeoutCondWaiter is a type allowing a consumer to wait on a TimeoutCond with a timeout. Wait() may be called multiple times, and will return true every time that the TimeoutCond is broadcast to. Once the configured timeout expires, Wait() will return false. Call Stop() to release resources once this TimeoutCondWaiter is no longer needed.
func (*TimeoutCondWaiter) Stop ¶
func (w *TimeoutCondWaiter) Stop()
func (*TimeoutCondWaiter) Wait ¶
func (w *TimeoutCondWaiter) Wait() bool