// Enable enables state transition controller. The transition controller needs to be in enabled state to allow transitions to be scheduled.
342007
func (s *stateTransitions) Enable() {
	s.Lock()

	if s.enabled {
		s.logger.Warn("state transition controller already enabled")
		s.Unlock()
		return
	}

	s.enabled = true
	s.Unlock()
	s.logger.Info("enabled state transition controller")
}
368207
func Enable(addr string) <-chan error {
	errs := make(chan error, 1)

	go func() {
		// The Handler function provides a default handler to expose metrics
		// via an HTTP server. "/metrics" is the usual endpoint for that.
		http.Handle("/metrics", promhttp.HandlerFor(registry, promhttp.HandlerOpts{}))
		errs <- http.ListenAndServe(addr, nil)
	}()

	return errs
}
567146
func (h *healthcheckManager) enable() {
	h.lock.Lock()
	defer h.lock.Unlock()
	h.enabled = true
}
220659
func (m *BaseMechanismManager) Disable() {
	atomic.StoreInt64(&m.activated, 0)
	atomic.StoreInt64(&m.enabled, 0)

	m.Mechanisms.Iter(func(_ string, mechanism Mechanism) bool {
		mechanism.Disable()
		return true
	})
}
115940
func (module *DTI2CModule) Enable() error {
	// Assign the pins so nothing else can allocate them.
	for _, pin := range module.definedPins {
		// fmt.Printf("assigning pin %d\n", pin)
		AssignPin(pin, module)
	}

	// @todo consider lazily opening the file. Since Enable is called automatically by BBB driver, this
	// @todo file will always be open even if i2c is not used.
	fd, e := os.OpenFile(module.deviceFile, os.O_RDWR, os.ModeExclusive)
	if e != nil {
		return e
	}
	module.fd = fd

	return nil
}
1208746
func (db *DB) EnableInfinite() {
	db.mu.Lock()
	defer db.mu.Unlock()

	db.infinite = true
}
587253
func (s *Server) Enable(extensions ...Extension) {
	s.extensions = append(s.extensions, extensions...)
}
810761
func Enable() {
	go func() {
		if err := http.ListenAndServe(apiAddress, nil); err != nil {
			log.WithError(err).Warn("Unable to serve pprof API")
		}
	}()
}
1206635
func (o *MockOracle) Enable() {
	o.Lock()
	defer o.Unlock()
	o.stop = false
}
479212
func (s *TransitionState) SetEnabled(v bool) *TransitionState {
	s.Enabled = &v
	return s
}
1117081
func Enable() {
	if !journal.Enabled() {
		logrus.Warning("Journal not available but user requests we log to it. Ignoring")
	} else {
		logrus.AddHook(&JournalHook{})
		logrus.SetOutput(ioutil.Discard)
	}
}
493563
func Enable(key string) {
	uppedKey := strings.ToUpper(key)
	if tracer, ok := tracers[uppedKey]; ok {
		tracer.enabled = true
	}
}
1274207
func (s *FeatureFlagSet) Enabled(m MetaContext, f Feature) (on bool) {
	on, err := s.EnabledWithError(m, f)
	if err != nil {
		m.Info("Error checking feature %q: %v", f, err)
		return false
	}
	return on
}
90850
func (m *BaseMechanism) Enable(c *MechanismContext) {
	m.C = c
	atomic.CompareAndSwapInt64(&m.enabled, 0, 1)
}
7550
func (c *CORSConfig) Enable(ctx context.Context, urls []string, headers []string) error {
	if len(urls) == 0 {
		return errors.New("at least one origin or the wildcard must be provided")
	}

	if strutil.StrListContains(urls, "*") && len(urls) > 1 {
		return errors.New("to allow all origins the '*' must be the only value for allowed_origins")
	}

	c.Lock()
	c.AllowedOrigins = urls

	// Start with the standard headers to Vault accepts.
	c.AllowedHeaders = append([]string{}, StdAllowedHeaders...)

	// Allow the user to add additional headers to the list of
	// headers allowed on cross-origin requests.
	if len(headers) > 0 {
		c.AllowedHeaders = append(c.AllowedHeaders, headers...)
	}
	c.Unlock()

	atomic.StoreUint32(c.Enabled, CORSEnabled)

	return c.core.saveCORSConfig(ctx)
}
963044
func (f *FeatureFlag) Enabled() bool {
	if f.enabled != nil {
		return *f.enabled
	}
	if f.defaultValue != nil {
		return *f.defaultValue
	}
	return false
}
29454
func (m *VHostManager) Enable(name string) {
	m.mu.Lock()
	defer m.mu.Unlock()

	h, ok := m.vhosts[name]
	if !ok {
		h = NewVHostHandler()
		m.vhosts[name] = h
	}
	h.Enable()
}