Documentation ¶
Overview ¶
Package cond provides an implementation very similar to sync.Cond, but with support for cancellation due to timeouts, dead tombs, or done contexts. However, one major difference is that Signal() and Broadcast() both require the lock
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cond ¶
func (*Cond) Broadcast ¶
func (c *Cond) Broadcast()
Broadcast will signal to all waiting threads, if any. Requires L to be locked.
func (*Cond) ContextWait ¶
ContextWait waits for a signal while the context is not Done. Requires L to be locked. Returns whether it received the signal.
func (*Cond) Signal ¶
func (c *Cond) Signal()
Signal will signal to a waiting thread, if any. Requires L to be locked.
func (*Cond) TimeoutWait ¶
TimeoutWait waits for a signal for up to a duration. Requires L to be locked. Returns whether it received the signal.