// Do runs user defined function with no interface.
// all parameters passed to the required call should be provided
// withing a function closure.
325205
func (cwg *ControlWaitGroup) Do(userFunc func()) bool {
	cwg.wg.Add(1)

	cwg.mu.Lock()
	cwg.waiting++
	cwg.mu.Unlock()

	cwg.sem.Acquire()
	cwg.mu.Lock()
	cwg.waiting--

	if cwg.abort {
		cwg.sem.Release()
		cwg.wg.Done()
		cwg.mu.Unlock()
		return false
	}

	cwg.mu.Unlock()

	go func() {
		defer cwg.wg.Done()
		defer cwg.sem.Release()
		userFunc()
	}()
	return true
}
380554
func (p *Probe) Do(f Func) {
	p.Lock()
	if p.inprogress != idle {
		p.Unlock()
		return
	}
	p.inprogress = active
	interval := p.interval
	p.Unlock()
	// Passed the lock. Now run f for as long it returns false. If a true is returned
	// we return from the goroutine and we can accept another Func to run.
	go func() {
		i := 1
		for {
			if err := f(); err == nil {
				break
			}
			time.Sleep(interval)
			if i%2 == 0 && i < 4 { // 4 is 2 doubles, so no need to increase anymore - this is *also* checked in double()
				p.double()
			}
			p.Lock()
			if p.inprogress == stop {
				p.Unlock()
				return
			}
			p.Unlock()
			i++
		}

		p.Lock()
		p.inprogress = idle
		p.Unlock()
	}()
}
172876
func (r *Request) Do() *Response {
	if r.err != nil {
		return &Response{
			err: r.err,
		}
	}

	req, err := r.request()
	if err != nil {
		return &Response{
			err: err,
		}
	}

	res, err := r.client.Do(req)
	if err != nil {
		return &Response{
			err: err,
		}
	}

	// return res, err
	return newResponse(res, err)
}
803256
func (f doFunc) Do(ctx context.Context, req *http.Request) (*http.Response, error) {
	return f(ctx, req)
}
735618
func (this *FCGIClient) Do(p map[string]string, req io.Reader) (r io.Reader, err error) {
	err = this.writeBeginRequest(uint16(FCGI_RESPONDER), 0)
	if err != nil {
		return
	}

	err = this.writePairs(FCGI_PARAMS, p)
	if err != nil {
		return
	}

	body := newWriter(this, FCGI_STDIN)
	if req != nil {
		io.Copy(body, req)
	}
	body.Close()

	r = &streamReader{c: this}
	return
}
891291
func (r *queryTable) Do(f func(flux.ColReader) error) error {
	return r.DoArrow(func(cr flux.ArrowColReader) error {
		return f(arrow.ColReader(cr))
	})
}
181496
func Do(args ...interface{}) Term {
	newArgs := []interface{}{}
	newArgs = append(newArgs, funcWrap(args[len(args)-1]))
	newArgs = append(newArgs, args[:len(args)-1]...)

	return constructRootTerm("Do", p.Term_FUNCALL, newArgs, map[string]interface{}{})
}
731703
func (e *etc) Do(path string, f func(p string) error) error {
	fullPath := makeFullPath(path)
	changer := e.values.At(fullPath...)
	if changer.Error() != nil {
		return changer.Error()
	}
	kvs, err := changer.List()
	if err != nil {
		return err
	}
	for _, kv := range kvs {
		p := pathToString(append(fullPath, kv.Key))
		err := f(p)
		if err != nil {
			return err
		}
	}
	return nil
}
323699
func (l *Client) Do(r *http.Request, response, data interface{}) error {
	// make the request

	res, err := l.client.Do(r)
	if err != nil {
		return err
	}
	defer res.Body.Close()

	// get the response
	b, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return err
	}

	// if we have some struct to unmarshal body into, do that and return
	if response != nil {
		err = buildRespJSON(b, response, data)
		if err != nil {
			return err
		}
		switch rt := response.(type) {
		case *ApiResp:
			// if we have an invalid response code error out
			if res.StatusCode >= 301 {
				return fmt.Errorf(rt.Message)
			}
		}
	}

	// if we have an invalid response code error out
	if res.StatusCode >= 301 {
		return fmt.Errorf("Received non-successful response: %d", res.StatusCode)
	}

	return nil
}
558234
func (f DoerFunc) Do(req *http.Request) (resp *http.Response, err error) {
	return f(req)
}
856262
func (c *Client) Do(req *http.Request) (*http.Response, error) {
	return c.client.Do(req)
}
342313
func Do(do DoFunc) Opt {
	return func(c *Client) Opt {
		old := c.do
		c.do = do
		return Do(old)
	}
}
697084
func (c *simpleRedis) do(commandName string, args ...interface{}) (interface{}, error) {
	t := c.stats.SubScope("redis").SubScope("latency").Timer(commandName)
	t.Start()
	defer t.Stop()

	conn := c.pool.Get()
	defer func() { _ = conn.Close() }()
	return conn.Do(commandName, args...)
}
619495
func (f PolicyFunc) Do(ctx context.Context, request Request) (Response, error) {
	return f(ctx, request)
}
10847
func (mr *MockHTTPClientMockRecorder) Do(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockHTTPClient)(nil).Do), arg0)
}
1229751
func (re *JSRE) Do(fn func(*otto.Otto)) {
	done := make(chan bool)
	req := &evalReq{fn, done}
	re.evalQueue <- req
	<-done
}
886410
func (t *odrTrie) do(key []byte, fn func() error) error {
	for {
		var err error
		if t.trie == nil {
			t.trie, err = trie.New(t.id.Root, trie.NewDatabase(t.db.backend.Database()))
		}
		if err == nil {
			err = fn()
		}
		if _, ok := err.(*trie.MissingNodeError); !ok {
			return err
		}
		r := &TrieRequest{Id: t.id, Key: key}
		if err := t.db.backend.Retrieve(t.db.ctx, r); err != nil {
			return err
		}
	}
}