Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcast ¶
type Broadcast struct {
// contains filtered or unexported fields
}
Broadcast implements notifying waiters via a channel.
The zero-value of this struct is valid.
func (*Broadcast) Broadcast ¶
func (c *Broadcast) Broadcast()
Broadcast closes the broadcast channel, triggering waiters.
func (*Broadcast) GetWaitCh ¶
func (c *Broadcast) GetWaitCh() <-chan struct{}
GetWaitCh returns a channel that is closed when Broadcast is called.
func (*Broadcast) HoldLock ¶ added in v1.6.0
func (c *Broadcast) HoldLock(cb func(broadcast func(), getWaitCh func() <-chan struct{}))
HoldLock locks the mutex and calls the callback.
func (*Broadcast) HoldLockMaybeAsync ¶ added in v1.11.1
func (c *Broadcast) HoldLockMaybeAsync(cb func(broadcast func(), getWaitCh func() <-chan struct{}))
HoldLockMaybeAsync locks the mutex and calls the callback if possible. If the mutex cannot be locked right now, starts a new Goroutine to wait for it.
Click to show internal directories.
Click to hide internal directories.