// Wait is part of the worker.Worker interface.
505319
func (w *stateWorker) Wait() error {
	err := w.catacomb.Wait()
	w.cleanupOnce.Do(func() {
		// Make sure the worker has exited before closing state.
		if err := w.stTracker.Done(); err != nil {
			logger.Warningf("error releasing state: %v", err)
		}
	})
	return err
}
32940
func (n *Node) Wait() {
	n.lock.RLock()
	if n.server == nil {
		n.lock.RUnlock()
		return
	}
	stop := n.stop
	n.lock.RUnlock()

	<-stop
}
1145445
func (a *agent) Wait() error {
	if a.stopCh == nil {
		err := errors.New("attempted to wait on an agent that wasn't Started")
		agentLogger.Error(err)
		return err
	}
	<-a.stopCh

	// If we get here, a.Stop() has already been called, and we are simply
	// retrieving the error if any squirreled away by stopOnce
	return a.Stop()
}
474750
func (c *runCmd) Wait() error {
	defer func() {
		_ = os.Remove(c.tmpFile)
	}()

	err := c.Cmd.Wait()
	if err != nil {
		return err
	}
	return nil
}
1189655
func (t Term) Wait(optArgs ...WaitOpts) Term {
	opts := map[string]interface{}{}
	if len(optArgs) >= 1 {
		opts = optArgs[0].toMap()
	}
	return constructMethodTerm(t, "Wait", p.Term_WAIT, []interface{}{}, opts)
}
940993
func (s *BatchServiceStateManager) Wait(tenantID string) {
	s.lock.RLock()
	var wg sync.WaitGroup
	for _, queue := range s.TenantQueues[tenantID] {
		wg.Add(1)
		go func(q *ServiceStateQueue) {
			s.drainQueue(q)
			wg.Done()
		}(queue)
	}
	s.lock.RUnlock()
	wg.Wait()
}
121417
func (s *stopChan) Wait() {
	if s == nil {
		return
	}
	s.cond.L.Lock()
	defer s.cond.L.Unlock()
	for !s.stopped {
		s.cond.Wait()
	}
}
1067845
func (cond *Cond) Wait(mutex *Mutex) error {
	ret := int(C.SDL_CondWait(cond.cptr(), mutex.cptr()))
	if ret != 0 {
		return GetError()
	}
	return nil
}
643258
func (s *service) Wait(ctx context.Context, r *taskAPI.WaitRequest) (*taskAPI.WaitResponse, error) {
	return nil, errdefs.ErrNotImplemented
}
1234917
func (t *Tomb) Wait() error {
	t.init()
	<-t.dead
	t.m.Lock()
	reason := t.reason
	t.m.Unlock()
	return reason
}
193793
func (m *MockNotifyWatcher) Wait() error {
	ret := m.ctrl.Call(m, "Wait")
	ret0, _ := ret[0].(error)
	return ret0
}
254335
func (pool *Pool) Wait(job *Job) error {
	sess := pool.redis.Get()
	defer sess.Close()

	for {
		reply, err := sess.Do("SHOW", job.ID)
		if err != nil {
			return err
		}
		if reply == nil {
			break
		}

		time.Sleep(50 * time.Millisecond)
	}

	return nil
}
1251127
func (w wrappedWorker) Wait() error {
	err := w.Worker.Wait()
	if err == ErrRefresh {
		err = dependency.ErrBounce
	}
	return err
}
924618
func Wait(b bool) Option {
	return func(o *Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, "wait", b)
	}
}
1248953
func (d *decompressor) wait() (Block, error) {
	d.wg.Wait()
	blk := d.blk
	d.blk = nil
	return blk, d.err
}
217527
func (s semaphore) wait(ctx context.Context) error {
	// Always check Err first. "select" randomly selects a channel when both
	// channels are available, and we want to prioritize cancelation.
	if err := ctx.Err(); err != nil {
		return err
	}
	select {
	case <-ctx.Done():
		// Err() is guaranteed to be non-nil.
		return ctx.Err()
	case <-s:
		/*
			// Do a last check, just in case. It makes things slightly slower but
			// reduces the chance of race condition with having a spurious item running
			// after cancelation.
			if err := ctx.Err(); err != nil {
				s.signal()
				return err
			}
		*/
		return nil
	}
}
909671
func (w *Waiter) Wait() {
	w.Lock()
	for w.cnt != 0 {
		w.cv.Wait()
	}
	w.Unlock()
}