// Start the encoder.
359699
func (a *AES) Start() error {
	if a.Key == nil && a.KeyB64 == "" {
		return errors.New("key undefined for AES")
	}
	if a.Key == nil {
		res, err := base64.StdEncoding.DecodeString(a.KeyB64)
		if err != nil {
			return err
		}
		a.Key = res
	}
	if len(a.Key) < 32 {
		return errors.New("key size must be at least 32 bytes")
	}
	return nil
}
286236
func (e *emitter) Start() {
	if !e.started {
		e.started = true
		e.wg.Add(1)
		go e.startEventListener(&e.wg)
	}
}
972321
func (b *buffer) start() (err error) {
	if b.pos == b.promptLen {
		return
	}

	for ln, _ := b.pos2xy(b.pos); ln > 0; ln-- {
		if _, err = term.Output.Write(CursorUp); err != nil {
			return outputError(err.Error())
		}
	}

	if _, err = fmt.Fprintf(term.Output, "\r\033[%dC", b.promptLen); err != nil {
		return outputError(err.Error())
	}
	b.pos = b.promptLen
	return
}
539971
func (w *Writer) start() error {
	for {
		// Exit if the stream is closed.
		if w.closed {
			return nil
		}

		<-w.throttle
		if err := w.Flush(); err != nil {
			return err
		}
	}
}
1308805
func NewEncoder(w io.Writer, e runtime.Encoder) Encoder {
	return &encoder{
		writer:  w,
		encoder: e,
		buf:     &bytes.Buffer{},
	}
}
272883
func (k *KafkaSpanSink) Start(cl *trace.Client) error {
	producer, err := newConfiguredProducer(k.logger, k.brokers, k.config)
	if err != nil {
		return err
	}
	k.producer = producer
	return nil
}
1000581
func (n *Driver) Start() (err error) {
	go func() {
		for {
			buff := make([]byte, 1024)
			_, err := n.adaptor().sp.Read(buff[:])
			if err != nil {
				n.Publish(n.Event("error"), err)
			} else {
				n.parse(bytes.NewBuffer(buff))
			}
		}
	}()
	return
}
833573
func (i *InformerHolder) Start(stopCh <-chan struct{}) {
	i.kubernetesInformers.Start(stopCh)
	i.authorizationInformers.Start(stopCh)
	i.imageInformers.Start(stopCh)
	i.oauthInformers.Start(stopCh)
	i.quotaInformers.Start(stopCh)
	i.routeInformers.Start(stopCh)
	i.securityInformers.Start(stopCh)
	i.userInformers.Start(stopCh)
}
777827
func (l *Linearizer) Start() {
	for {
		// Check context error
		if l.ctx.Err() != nil {
			l.md.Lock()
			l.dispatchEvent(&event{err: l.ctx.Err()})
			return
		}

		// Get bytes from pool
		var b = l.bytesPool.Get().([]byte)

		// Read
		n, err := l.r.Read(b)
		if err != nil {
			l.md.Lock()
			l.dispatchEvent(&event{err: err})
			return
		}

		// Dispatch event in a go routine so that it doesn't block the read
		l.md.Lock()
		go l.dispatchEvent(&event{b: b, n: n})
	}
}
77764
func (p *Parser) Start() (err error) {
	var msg *outerMessage

	defer p.afterStop()

	defer func() {
		if x, ok := recover().(error); ok {
			err = x
		}
	}()

	// Loop through all outer messages until we're signaled to stop. Stopping
	// happens when either the OnCDemoStop message is encountered or
	// parser.Stop() is called programatically.
	for !p.isStopping {
		if p.stopAtTick > 0 && p.Tick > p.stopAtTick {
			return
		}

		msg, err = p.readOuterMessage()
		if err != nil {
			if err == io.EOF {
				err = nil
			}
			return
		}

		p.Tick = msg.tick

		if err = p.Callbacks.callByDemoType(msg.typeId, msg.data); err != nil {
			return
		}
	}

	return
}
138081
func (s *stream) Start() error {
	if s.ref != nilstream {
		return nil
	}
	wg.Wait()
	p := C.CFStringCreateWithCStringNoCopy(C.kCFAllocatorDefault, C.CString(s.path), C.kCFStringEncodingUTF8, C.kCFAllocatorDefault)
	path := C.CFArrayCreate(C.kCFAllocatorDefault, (*unsafe.Pointer)(unsafe.Pointer(&p)), 1, nil)
	ctx := C.FSEventStreamContext{}
	ref := C.EventStreamCreate(&ctx, C.uintptr_t(s.info), path, C.FSEventStreamEventId(atomic.LoadUint64(&since)), latency, flags)
	if ref == nilstream {
		return errCreate
	}
	C.FSEventStreamScheduleWithRunLoop(ref, runloop, C.kCFRunLoopDefaultMode)
	if C.FSEventStreamStart(ref) == C.Boolean(0) {
		C.FSEventStreamInvalidate(ref)
		return errStart
	}
	C.CFRunLoopWakeUp(runloop)
	s.ref = ref
	return nil
}
888024
func New() *Encoders {
	return &Encoders{
		encoders: make(map[string]respond.Encoder),
		Default:  respond.JSON,
	}
}
465718
func (d *TMP006) Start() error {
	if err := d.setup(); err != nil {
		return err
	}

	d.rawDieTemps = make(chan float64)
	d.objTemps = make(chan float64)

	go func() {
		var rawDieTemp, objTemp float64
		var rdtAvlb, otAvlb bool
		var err error
		var timer <-chan time.Time
		resetTimer := func() {
			timer = time.After(time.Duration(d.SampleRate.timeRequired*1000) * time.Millisecond)
		}
		resetTimer()

		for {
			var rawDieTemps, objTemps chan float64

			if rdtAvlb {
				rawDieTemps = d.rawDieTemps
			}
			if otAvlb {
				objTemps = d.objTemps
			}

			select {
			case <-timer:
				var rdt float64
				if rdt, err = d.measureRawDieTemp(); err != nil {
					glog.Errorf("tmp006: %v", err)
				} else {
					rawDieTemp = rdt
					rdtAvlb = true
				}
				var ot float64
				if ot, err = d.measureObjTemp(); err != nil {
					glog.Errorf("tmp006: %v", err)
				} else {
					objTemp = ot
					otAvlb = true
				}
				resetTimer()
			case rawDieTemps <- rawDieTemp:
				rdtAvlb = false
			case objTemps <- objTemp:
				otAvlb = false
			case waitc := <-d.closing:
				waitc <- struct{}{}
				close(d.rawDieTemps)
				close(d.objTemps)
				return
			}
		}
	}()

	return nil
}
134438
func (p *Parser) Start() {
	go func() {
		defer close(p.Done)
		expressions := make([]Sexp, 0, SliceDefaultCap)

		// maybe we already have input, be optimistic!
		// no need to call p.GetMoreInput() before staring
		// our loop.

		for {
			expr, err := p.ParseExpression(0)
			if err != nil || expr == SexpEnd {
				if err == ParserHaltRequested {
					return
				}
				err = p.GetMoreInput(expressions, err)
				if err == ParserHaltRequested {
					return
				}
				// GetMoreInput will have delivered what we gave them. Reset since we
				// don't own that memory any more.
				expressions = make([]Sexp, 0, SliceDefaultCap)
			} else {
				// INVAR: err == nil && expr is not SexpEnd
				expressions = append(expressions, expr)
			}
		}
	}()
}
606576
func (e *Encoder) Reset(w io.Writer) {
	if w == nil {
		return
	}
	// var ok bool
	e.bytes = false
	if e.wf == nil {
		e.wf = new(bufioEncWriter)
	}
	// e.typ = entryTypeUnset
	// if e.h.WriterBufferSize > 0 {
	// 	// bw := bufio.NewWriterSize(w, e.h.WriterBufferSize)
	// 	// e.wi.bw = bw
	// 	// e.wi.sw = bw
	// 	// e.wi.fw = bw
	// 	// e.wi.ww = bw
	// 	if e.wf == nil {
	// 		e.wf = new(bufioEncWriter)
	// 	}
	// 	e.wf.reset(w, e.h.WriterBufferSize)
	// 	e.typ = entryTypeBufio
	// } else {
	// 	if e.wi == nil {
	// 		e.wi = new(ioEncWriter)
	// 	}
	// 	e.wi.reset(w)
	// 	e.typ = entryTypeIo
	// }
	e.wf.reset(w, e.h.WriterBufferSize)
	// e.typ = entryTypeBufio

	// e.w = e.wi
	e.resetCommon()
}
1341928
func (rkq *RekeyQueueStandard) start(ctx context.Context) {
	go func() {
		for {
			select {
			case id := <-rkq.queue:
				if err := rkq.limiter.Wait(ctx); err != nil {
					rkq.log.Debug("Waiting on rate limiter for tlf=%v error: %v", id, err)
					return
				}
				rkq.config.KBFSOps().RequestRekey(context.Background(), id)
				func(id tlf.ID) {
					rkq.mu.Lock()
					defer rkq.mu.Unlock()
					delete(rkq.pendings, id)
				}(id)
			case err := <-ctx.Done():
				rkq.log.Debug("Rekey queue background routine context done: %v", err)
				return
			}
		}
	}()
}
584617
func (b *blockDec) startDecoder() {
	for range b.input {
		//println("blockDec: Got block input")
		switch b.Type {
		case blockTypeRLE:
			if cap(b.dst) < int(b.RLESize) {
				if b.lowMem {
					b.dst = make([]byte, b.RLESize)
				} else {
					b.dst = make([]byte, maxBlockSize)
				}
			}
			o := decodeOutput{
				d:   b,
				b:   b.dst[:b.RLESize],
				err: nil,
			}
			v := b.data[0]
			for i := range o.b {
				o.b[i] = v
			}
			hist := <-b.history
			hist.append(o.b)
			b.result <- o
		case blockTypeRaw:
			o := decodeOutput{
				d:   b,
				b:   b.data,
				err: nil,
			}
			hist := <-b.history
			hist.append(o.b)
			b.result <- o
		case blockTypeCompressed:
			b.dst = b.dst[:0]
			err := b.decodeCompressed(nil)
			o := decodeOutput{
				d:   b,
				b:   b.dst,
				err: err,
			}
			if debug {
				println("Decompressed to", len(b.dst), "bytes, error:", err)
			}
			b.result <- o
		case blockTypeReserved:
			// Used for returning errors.
			<-b.history
			b.result <- decodeOutput{
				d:   b,
				b:   nil,
				err: b.err,
			}
		default:
			panic("Invalid block type")
		}
		if debug {
			println("blockDec: Finished block")
		}
	}
}