// Off turns the motor off or sets the motor to a 0 speed
763645
func (m *MotorDriver) Off() (err error) {
	if m.isDigital() {
		err = m.changeState(0)
	} else {
		err = m.Speed(0)
	}
	return
}
979103
func (s *scheduler) Stop() {
	s.Lock()
	defer s.Unlock()

	if !s.started {
		return
	}
	close(s.shutdown)
	<-s.stopped
}
665972
func (w *minifyResponseWriter) Close() error {
	if w.writer != nil {
		return w.writer.Close()
	}
	return nil
}
359873
func (s *session) close() error {
	s.closeOnce.Do(func() {
		s.cancel()
		if s.conn != nil {
			s.conn.Close(false)
		}
		close(s.closed)
	})

	return nil
}
522817
func (s *PrioritySlot) Shutdown() {
	s.mu.Lock()
	defer s.mu.Unlock()
	if s.cancel != nil {
		s.cancel()
		s.cancel = nil
		s.priority = 0
	}
	s.shutdown = true
}
387047
func (l *RgbLedDriver) Off() (err error) {
	if err = l.SetLevel(l.pinRed, 0); err != nil {
		return
	}

	if err = l.SetLevel(l.pinGreen, 0); err != nil {
		return
	}

	if err = l.SetLevel(l.pinBlue, 0); err != nil {
		return
	}

	l.high = false
	return
}
699456
func (c *Controller) Shutdown(ctx context.Context) error {
	return c.c.Shutdown(ctx)
}
811424
func (t *Throttler) Close() error {
	close(t.close)
	t.stopped.Wait()
	return nil
}
336721
func (s *session) close() {
	s.tops.close()
	if s.manifest != nil {
		s.manifest.Close()
	}
	if s.manifestWriter != nil {
		s.manifestWriter.Close()
	}
	s.manifest = nil
	s.manifestWriter = nil
	s.setVersion(nil, &version{s: s, closing: true, id: s.ntVersionId})

	// Close all background goroutines
	close(s.closeC)
	s.closeW.Wait()
}
409199
func (k *Kademlia) Off(p *Peer) {
	k.lock.Lock()
	defer k.lock.Unlock()
	var del bool
	if !p.BzzPeer.LightNode {
		k.addrs, _, _, _ = pot.Swap(k.addrs, p, Pof, func(v pot.Val) pot.Val {
			// v cannot be nil, must check otherwise we overwrite entry
			if v == nil {
				panic(fmt.Sprintf("connected peer not found %v", p))
			}
			del = true
			return newEntry(p.BzzAddr)
		})
	} else {
		del = true
	}

	if del {
		k.conns, _, _, _ = pot.Swap(k.conns, p, Pof, func(_ pot.Val) pot.Val {
			// v cannot be nil, but no need to check
			return nil
		})
		// send new address count value only if the peer is deleted
		if k.addrCountC != nil {
			k.addrCountC <- k.addrs.Size()
		}
		k.sendNeighbourhoodDepthChange()
	}
}
518204
func (a *AdafruitMotorHatDriver) SetServoMotorPulse(channel byte, on, off int32) (err error) {
	if err = a.setPWM(a.servoHatConnection, channel, on, off); err != nil {
		return
	}
	return
}
725075
func (s *Stoppable) Stop() error {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	if s.shutdown {
		return fmt.Errorf("shutdown already in progress")
	}

	// We initialize the channel to avoid a race if we Stop before anyone is watching
	if s.stopChannel == nil {
		s.stopChannel = make(chan struct{})
	}
	close(s.stopChannel)
	glog.Infof("shutting down controller")
	s.shutdown = true

	return nil
}
462655
func (t *Timer) Stop() bool {
	if t.timer != nil {
		return t.timer.Stop()
	}

	registered := !t.stopped
	t.mock.removeClockTimer((*internalTimer)(t))
	t.stopped = true
	return registered
}
1031106
func (w *minifyWriter) Close() error {
	w.pw.Close()
	w.wg.Wait()
	return w.err
}
770878
func (c *Controller) Close() error {
	errc := make(chan error)
	c.closing <- errc
	return <-errc
}
470649
func (e *Environment) Stop() {
	e.mu.Lock()

	if !e.stopped {
		e.stopped = true
		close(e.stopCh)
	}

	e.mu.Unlock()
}
1023563
func (s *serialWriteCloser) Close() error {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.wc.Close()
}