// reset resets keep alive state
// and sends the state back to the initial state
// of sending full update
770937
func (h *Heartbeat) reset(state KeepAliveState) {
	h.setState(state)
	h.nextAnnounce = time.Time{}
	h.nextKeepAlive = time.Time{}
	h.keepAlive = nil
	if h.keepAliver != nil {
		if err := h.keepAliver.Close(); err != nil {
			h.Warningf("Failed to close keep aliver: %v", err)
		}
		h.keepAliver = nil
	}
}
240221
func (worker *Worker) Reset() {
	outpack := getOutPack()
	outpack.dataType = dtResetAbilities
	worker.broadcast(outpack)
	worker.funcs = make(jobFuncs)
}
449508
func (i *FSTIterator) Reset(f *FST,
	startKeyInclusive, endKeyExclusive []byte, aut Automaton) error {
	if aut == nil {
		aut = alwaysMatchAutomaton
	}

	i.f = f
	i.startKeyInclusive = startKeyInclusive
	i.endKeyExclusive = endKeyExclusive
	i.aut = aut

	return i.pointTo(startKeyInclusive)
}
1146357
func (w *ResponseRecorder) Reset() {
	w.ClearHeaders()
	w.WriteHeader(defaultStatusCode)
	w.ResetBody()
}
1143428
func (c *Cache) Reset() {
	c.Lock()
	defer c.Unlock()
	c.m = make(map[string]*list.Element, c.config.MaxItems)
	c.l.Init()
	c.size = 0
}
1291125
func (s *Service) Reset(id int64) *ResetCall {
	c := &ResetCall{s: s, urlParams_: make(gensupport.URLParams)}
	c.id = id
	return c
}
553013
func (w *WalletState) Reset(mctx libkb.MetaContext) {
	w.Lock()
	defer w.Unlock()
	w.resetWithLock(mctx)
}
65826
func (r *realTimer) Reset(d time.Duration) bool {
	return r.timer.Reset(d)
}
133326
func (t *Timer) Reset(d time.Duration) bool {
	return t.timer.Reset(d)
}
169321
func (s *SSD1306Driver) Reset() (err error) {
	s.rstDriver.DigitalWrite(1)
	time.Sleep(10 * time.Millisecond)
	s.rstDriver.DigitalWrite(0)
	time.Sleep(10 * time.Millisecond)
	s.rstDriver.DigitalWrite(1)
	return nil
}
756614
func (c *Cache) Reset() {
	c.lock.Lock()
	defer c.lock.Unlock()

	c.cache = make(map[interface{}]*list.Element)
	c.lru.Init()
}
1269537
func Reset(c *gc.C) {
	logger.Infof("reset model")
	dummy.mu.Lock()
	dummy.ops = discardOperations
	oldState := dummy.state
	dummy.controllerState = nil
	dummy.state = make(map[string]*environState)
	dummy.newStatePolicy = stateenvirons.GetNewPolicyFunc()
	dummy.supportsSpaces = true
	dummy.supportsSpaceDiscovery = false
	dummy.mu.Unlock()

	// NOTE(axw) we must destroy the old states without holding
	// the provider lock, or we risk deadlocking. Destroying
	// state involves closing the embedded API server, which
	// may require waiting on RPC calls that interact with the
	// EnvironProvider (e.g. EnvironProvider.Open).
	for _, s := range oldState {
		if s.httpServer != nil {
			logger.Debugf("closing httpServer")
			s.httpServer.Close()
		}
		s.destroy()
	}
	if mongoAlive() {
		err := retry.Call(retry.CallArgs{
			Func: gitjujutesting.MgoServer.Reset,
			// Only interested in retrying the intermittent
			// 'unexpected message'.
			IsFatalError: func(err error) bool {
				return !strings.HasSuffix(err.Error(), "unexpected message")
			},
			Delay:    time.Millisecond,
			Clock:    clock.WallClock,
			Attempts: 5,
		})
		c.Assert(err, jc.ErrorIsNil)
	}
}
793
func (s *BulkService) Reset() {
	s.requests = make([]BulkableRequest, 0)
	s.sizeInBytes = 0
	s.sizeInBytesCursor = 0
}
692139
func (ini *Init) Reset() {
	mu := ini.init.ResetWithLock()
	defer mu.Unlock()
	for _, d := range ini.children {
		d.Reset()
	}
}
679737
func (s *PacketStore) Reset() {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	s.packets = make(map[packet.ID]packet.Generic)
}
763577
func (s *Storage) Reset() {
	s.setBadger(storage.TotalCountKey, 0)
	s.setBadger(storage.IosSuccessKey, 0)
	s.setBadger(storage.IosErrorKey, 0)
	s.setBadger(storage.AndroidSuccessKey, 0)
	s.setBadger(storage.AndroidErrorKey, 0)
}
613496
func (s *Stream) Reset() error {
	err := s.stream.Reset()
	s.state.Lock()
	switch s.state.v {
	case streamOpen, streamCloseRead, streamCloseWrite:
		s.state.v = streamReset
		s.remove()
	}
	s.state.Unlock()
	return err
}