// terminateState forcefully shuts down the state machine
163963
func terminateState(d *httpDecoder) httpState {
	log.V(2).Infoln(d.idtag + "terminate-state")
	// closing these chans tells Decoder users that it's wrapping up
	close(d.msg)
	close(d.errCh)

	// attempt to forcefully close the connection and signal response handlers that
	// no further responses should be written
	d.Cancel(false)

	if d.con != nil {
		d.con.Close()
	}

	// there is no spoon
	return nil
}
1254916
func (s *lockBasedTxSimulator) DeleteState(ns string, key string) error {
	return s.SetState(ns, key, nil)
}
1281791
func (s *LifecyclePolicy) SetState(v string) *LifecyclePolicy {
	s.State = &v
	return s
}
394013
func (s *FinalizeDeviceClaimOutput) SetState(v string) *FinalizeDeviceClaimOutput {
	s.State = &v
	return s
}
1063782
func (m *MemoryBackend) Terminate(client *Client) error {
	// acquire global mutex
	m.globalMutex.Lock()
	defer m.globalMutex.Unlock()

	// release session if available
	sess, ok := client.Session().(*memorySession)
	if ok && sess != nil {
		sess.owner = nil
	}

	// remove any temporary session
	delete(m.temporarySessions, client)

	// remove any saved client
	delete(m.activeClients, client.ID())

	return nil
}
1058289
func (s *DeleteReservationOutput) SetState(v string) *DeleteReservationOutput {
	s.State = &v
	return s
}
537395
func (s *GetVaultLockOutput) SetState(v string) *GetVaultLockOutput {
	s.State = &v
	return s
}
645035
func (s *CreateLifecyclePolicyInput) SetState(v string) *CreateLifecyclePolicyInput {
	s.State = &v
	return s
}
199936
func (p *StatePool) SystemState() *State {
	p.mu.Lock()
	defer p.mu.Unlock()
	// State pool is closed, no more access to the system state.
	if p.pool == nil {
		return nil
	}
	return p.systemState
}
1171144
func (p *setnsProcess) terminate() error {
	if p.cmd.Process == nil {
		return nil
	}
	err := p.cmd.Process.Kill()
	if _, werr := p.wait(); err == nil {
		err = werr
	}
	return err
}
133377
func (r *SearchRequest) TerminateAfter(docs int) *SearchRequest {
	r.searchSource = r.searchSource.TerminateAfter(docs)
	return r
}
707367
func (fa *failAction) Execute(state State) (*State, error) {
	if err := fa.callbacks.FailAction(fa.actionId, "action terminated"); err != nil {
		return nil, err
	}

	return stateChange{
		Kind:     RunAction,
		Step:     Done,
		ActionId: &fa.actionId,
		Hook:     state.Hook,
	}.apply(state), nil
}
785816
func stateEndTop(s *scanner, c byte) int {
	if c != ' ' && c != '\t' && c != '\r' && c != '\n' {
		// Complain about non-space byte on next call.
		s.error(c, "after top-level value")
	}
	return scanEnd
}
1006308
func TerminateApp(context Context, log Log) error {
	appExecName := "Keybase"
	logf := logger.NewLoggerf(log)
	log.Info("Stopping Keybase app")
	appPIDs := process.TerminateAll(process.NewMatcher(appExecName, process.ExecutableEqual, logf), 5*time.Second, logf)
	if len(appPIDs) > 0 {
		log.Info("Terminated %s %v", appExecName, appPIDs)
	}
	return nil
}
792114
func (l *loop) terminate(err error) {
	l.mux.Lock()
	defer l.mux.Unlock()
	if l.err == nil {
		l.err = err
	}
	if l.status != Running {
		return
	}
	l.status = Stopping
	select {
	case <-l.stopC:
	default:
		close(l.stopC)
	}
}
1369458
func stateEndTop(s *Scanner, c int) int {
	if c != ' ' && c != '\t' && c != '\r' && c != '\n' {
		// Complain about non-space byte on next call.
		s.error(c, "after top-level value")
	}
	return ScanEnd
}
627922
func (l *State) CheckState(id types.CheckID) *CheckState {
	l.RLock()
	defer l.RUnlock()

	c := l.checks[id]
	if c == nil || c.Deleted {
		return nil
	}
	return c.Clone()
}