base: Index | Files

package ctxsync

import ""


Package Files


type Cond Uses

type Cond struct {
    // contains filtered or unexported fields

A Cond is a condition variable that implements a context-aware Wait.

func NewCond Uses

func NewCond(l sync.Locker) *Cond

NewCond returns a new ContextCond based on Locker l.

func (*Cond) Broadcast Uses

func (c *Cond) Broadcast()

Broadcast notifies waiters of a state change. Broadcast must only be called while the cond's lock is held.

func (*Cond) Done Uses

func (c *Cond) Done() <-chan struct{}

Done returns a channel that is closed after the next broadcast of this Cond. Done must be called with the Cond's lock held; the lock is released before Done returns.

func (*Cond) Wait Uses

func (c *Cond) Wait(ctx context.Context) error

Wait returns after the next call to Broadcast, or if the context is complete. The context's lock must be held when calling Wait. An error returns with the context's error if the context completes while waiting.

Package ctxsync imports 2 packages (graph) and is imported by 4 packages. Updated 2019-10-06. Refresh now. Tools for package owners.