Set the service's state and log the change. Notify all waiters of state change.
437207
private void setState(State newState) {
        m_logger.debug("Entering state: {}", newState.toString());
        synchronized (m_stateChangeLock) {
            m_state = newState;
            m_stateChangeLock.notifyAll();
        }
    }
595393
protected final void setStateNotify(final int newState)
	{
		synchronized (lock) {
			setState(newState);
			if (newState == OK && !inBlockingSend)
				this.sendWaitQueue.release(false);
			// worst case: we notify 2 threads, the closing one and 1 sending
			lock.notifyAll();
		}
	}
1320653
public void setState(S state){
		Integer id = definition.getStateId(state);
		currentStateId.set(id);
	}
654141
function(state) {
    if (state == self.LOADING || self.readyState !== state) {
      self.readyState = state;

      if (settings.async || self.readyState < self.OPENED || self.readyState === self.DONE) {
        self.dispatchEvent("readystatechange");
      }

      if (self.readyState === self.DONE && !errorFlag) {
        self.dispatchEvent("load");
        // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie)
        self.dispatchEvent("loadend");
      }
    }
  }
1138565
def _notify_change(self):
        
        d = self.declaration
        self._notify_count -= 1
        if self._notify_count == 0:
            #: Tell the UI we made changes
            self.adapter.notifyDataSetChanged(now=True)
            self.get_context().timed_call(
                500, self._queue_pending_calls)
1150318
@Override
  public synchronized void start() {
    startTime = System.currentTimeMillis();
    ensureCurrentState(STATE.INITED);
    changeState(STATE.STARTED);
    LOG.info("Service:" + getName() + " is started.");
  }
1239750
def notify_all(self):
        
        if not self._is_owned():
            raise RuntimeError("cannot wait on un-acquired lock")
        scheduler.state.awoken_from_events.update(x[0] for x in self._waiters)
        self._waiters.clear()
556046
synchronized void statusUpdate(float progress,
                                 String state, 
                                 Counters counters) {
    setProgress(progress);
    setStateString(state);
    setCounters(counters);
  }
1239156
protected void notifyChangeListeners() {
        ChangeEvent e = new ChangeEvent(this);
        for (ChangeListener l : changeListeners) {
            l.stateChanged(e);
        }
    }
1134916
def set_status(self, status):
        
        if status is not self.status:
            logger.debug("Setting %s state to %s.", self.stack.name,
                         status.name)
            self.status = status
            self.last_updated = time.time()
            if self.stack.logging:
                log_step(self)
669941
def on_state_changed(self, state):
        """"""
        if state:
            self.editor.sig_key_pressed.connect(self._on_key_pressed)
        else:
            self.editor.sig_key_pressed.disconnect(self._on_key_pressed)
1086754
def _wait_for_state_change(self, target_states, update_interval=10):
        
        while self.state not in target_states:
            if self.state == 'error':
                raise Exception('server is in error state')

            # update server state every 10s
            sleep(update_interval)
            self.populate()
269922
async def update_state(self, msg, _context):
        """"""

        name = msg.get('name')
        status = msg.get('new_status')

        await self.service_manager.update_state(name, status)
1156419
protected final void notifyChanged() {
        for (int i = mObservers.size() - 1; i >= 0; i--) {
            mObservers.get(i).onChanged();
        }
    }
157574
protected void onServiceInstanceChanged(ServiceInstance instance){
        String serviceName = instance.getServiceName();
        synchronized(notificationHandlers){
            if(notificationHandlers.containsKey(serviceName)){
                for(NotificationHandler h : notificationHandlers.get(serviceName)){
                    h.serviceInstanceChange(instance);
                }
            }
        }
    }
1256681
def on_state_changed(self, state):
        
        if state:
            self.editor.sig_breakpoints_changed.connect(self.repaint)
            self.editor.sig_debug_stop.connect(self.set_current_line_arrow)
            self.editor.sig_debug_stop[()].connect(self.stop_clean)
            self.editor.sig_debug_start.connect(self.start_clean)
        else:
            self.editor.sig_breakpoints_changed.disconnect(self.repaint)
            self.editor.sig_debug_stop.disconnect(self.set_current_line_arrow)
            self.editor.sig_debug_stop[()].disconnect(self.stop_clean)
            self.editor.sig_debug_start.disconnect(self.start_clean)
748319
def set_current_state(self):
        """""""
        if not self.thresholds:
            self.thresholds = self.parent.get_existing_keyword('thresholds')
        if not self.value_maps:
            self.value_maps = self.parent.get_existing_keyword('value_maps')