import "github.com/andy2046/gopie/pkg/barrier"
Package barrier provides a barrier implementation.
var (
// ErrBroken when barrier is broken.
ErrBroken = errors.New("barrier is broken")
)type Barrier struct {
// contains filtered or unexported fields
}Barrier is a synchronizer that allows members to wait for each other.
func New(n int) *BarrierNew returns a new barrier.
func (b *Barrier) Await(ctx context.Context) errorAwait waits until all members have called await on the barrier.
func (b *Barrier) IsBroken() boolIsBroken returns true if the barrier is broken.
func (b *Barrier) N() intN returns the number of members for the barrier.
func (b *Barrier) NWaiting() intNWaiting returns the number of members currently waiting at the barrier.
func (b *Barrier) Reset()Reset resets the barrier to initial state.
Generated by godoc2md