Documentation ¶
Overview ¶
Package cancelcond implements a wrapper around sync.Cond that response to context.Context cancellation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cond ¶
Cond is a wrapper around a sync.Cond that overloads its Wait method to accept a Context. This Context can be cancelled to prematurely terminate the Wait().
func (*Cond) Wait ¶
Wait wraps sync.Cond's Wait() method. It blocks, waiting for the underlying Conn to be signalled. If the Context is cancelled prematurely, Wait() will signal the underlying Cond and unblock it.
Wait must be called while holding the Cond's lock. It yields the lock while it is blocking and reclaims it prior to returning.
Click to show internal directories.
Click to hide internal directories.