// WaitTimeout synchronously waits for the container to terminate or the duration to elapse. It
// returns false if timeout occurs.
545636
func (container *container) WaitTimeout(timeout time.Duration) error {
	container.waitOnce.Do(func() {
		container.waitCh = make(chan struct{})
		go func() {
			container.waitErr = container.Wait()
			close(container.waitCh)
		}()
	})
	t := time.NewTimer(timeout)
	defer t.Stop()
	select {
	case <-t.C:
		return &ContainerError{Container: container, Err: ErrTimeout, Operation: "hcsshim::ComputeSystem::Wait"}
	case <-container.waitCh:
		return container.waitErr
	}
}
880735
func (r *SubReply) Timeout() bool {
	if r.Err == nil {
		return false
	}
	t, ok := r.Err.(*net.OpError)
	return ok && t.Timeout()
}
74977
func (nm *NamedMutex) TryLockTimeout(name string, timeout time.Duration) bool {
	nm.localMutex.Lock()
	mc, ok := nm.mutexMap[name]
	if !ok {
		mc = make(chan struct{}, 1)
		nm.mutexMap[name] = mc
	}
	nm.localMutex.Unlock()
	select {
	case mc <- struct{}{}:
		return true
	case <-time.After(timeout):
		return false
	}
}
265756
func (c *Client) SetTimeout(max time.Duration) {
	atomic.StoreInt64((*int64)(&c.timeout), (int64)(max))
}
1320642
func (c *Client) SetTimeout(t int) *Client {
	c.Timeout = t
	return c
}
82272
func (s *IndicesDeleteTemplateService) MasterTimeout(masterTimeout string) *IndicesDeleteTemplateService {
	s.masterTimeout = masterTimeout
	return s
}
709460
func (s *XPackWatcherDeactivateWatchService) MasterTimeout(masterTimeout string) *XPackWatcherDeactivateWatchService {
	s.masterTimeout = masterTimeout
	return s
}
1052358
func (rc *ReadinessCheck) SetTimeout(timeout time.Duration) *ReadinessCheck {
	secs := int(timeout.Seconds())
	rc.TimeoutSeconds = secs
	return rc
}
1123266
func (s *IngestDeletePipelineService) Timeout(timeout string) *IngestDeletePipelineService {
	s.timeout = timeout
	return s
}
595434
func (s *IndicesShrinkService) Timeout(timeout string) *IndicesShrinkService {
	s.timeout = timeout
	return s
}
985159
func (s *JobUpdate) SetTimeout(v int64) *JobUpdate {
	s.Timeout = &v
	return s
}
898562
func RequestTimeout(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusRequestTimeout, response)
}
897961
func (s *XPackWatcherActivateWatchService) MasterTimeout(masterTimeout string) *XPackWatcherActivateWatchService {
	s.masterTimeout = masterTimeout
	return s
}
969862
func (s *IndicesOpenService) Timeout(timeout string) *IndicesOpenService {
	s.timeout = timeout
	return s
}
64871
func Timeout(timeout time.Duration) func(*Client) error {
	return func(c *Client) error {
		c.timeout = timeout
		return nil
	}
}
4585
func (s *IndicesPutMappingService) MasterTimeout(masterTimeout string) *IndicesPutMappingService {
	s.masterTimeout = masterTimeout
	return s
}
179707
func (s *XPackWatcherAckWatchService) MasterTimeout(masterTimeout string) *XPackWatcherAckWatchService {
	s.masterTimeout = masterTimeout
	return s
}