/*  unawait a state
186204
function () {
            /*  determine parameters  */
            var params = $cs.params("unawait", arguments, {
                id: { pos: 0, req: true }
            });

            /*  unsubscribe from service event if it is not yet unsubscribed  */
            if (this._subscription(params.id))
                this.unsubscribe(params.id);
            return;
        }
901878
def wait(state)
      if !LXC::Shell.valid_state?(status.state)
        raise ArgumentError, "Invalid container state: #{state}"
      end

      run("wait", "-s", state)
    end
1083614
private void handleUnready(String address) {
    log.debug(String.format("%s - Received unready message from: %s", NetworkManager.this, address));
    ready.remove(address);
    checkUnready();
  }
1107948
function _readyStateChange(state) {
            this.readyState = state;

            if (typeof this.onreadystatechange == "function") {
                this.onreadystatechange();
            }

            this.dispatchEvent(new HttpRequestEvent("readystatechange"));

            if (this.readyState == IsotropyXMLHttpRequest.DONE) {
                this.dispatchEvent(new HttpRequestEvent("load", false, false, this));
                this.dispatchEvent(new HttpRequestEvent("loadend", false, false, this));
            }
        }
346488
def state_wait(set, state)
      # do a special wait, if waiting for operational (for dns)
      if state == "operational"
        set.each { |server| server.wait_for_operational_with_dns }
      else
        set.each { |server| server.wait_for_state(state) }
      end
    end
186495
public CallOptions withoutWaitForReady() {
    CallOptions newOptions = new CallOptions(this);
    newOptions.waitForReady = Boolean.FALSE;
    return newOptions;
  }
169349
protected void checkState(InitializedState minState, InitializedState maxState) {
        PreconditionUtil.verify(initializedState.ordinal() >= minState.ordinal(), "not yet initialized, cannot yet be called");
        PreconditionUtil
                .verify(initializedState.ordinal() <= maxState.ordinal(), "already initialized, cannot be called anymore");
    }
997475
function( required, startFunc ) {
		var self = this;

		if ( required !== self.state ) {
			self._stateError( startFunc || self.requireState );
		}

		return self;
	}
58958
function(state) {
            if (wakeup !== undefined) {
              midDuration = wakeup.ts - prevSlice.end;
            }

            if (blocked_reason !== undefined) {
              var args = {
                'kernel callsite when blocked:' : blocked_reason.caller
              };
              if (blocked_reason.iowait) {
                switch (state) {
                  case SCHEDULING_STATE.UNINTR_SLEEP:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_IO;
                    break;
                  case SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL_IO;
                    break;
                  case SCHEDULING_STATE.UNINTR_SLEEP_WAKING:
                    state = SCHEDULING_STATE.UNINTR_SLEEP_WAKE_KILL_IO;
                    break;
                  default:
                }
              }
              slices.push(new tr.model.ThreadTimeSlice(
                  thread,
                  state, '', prevSlice.end, args, midDuration));
            } else {
              slices.push(new tr.model.ThreadTimeSlice(
                  thread,
                  state, '', prevSlice.end, {}, midDuration));
            }
            if (wakeup !== undefined) {
              var wakeupDuration = nextSlice.start - wakeup.ts;
              var args = {'wakeup from tid': wakeup.fromTid};
              slices.push(new tr.model.ThreadTimeSlice(
                  thread, SCHEDULING_STATE.RUNNABLE, '',
                  wakeup.ts, args, wakeupDuration));
              wakeup = undefined;
            }
          }
1084147
function ( obj, arg, state ) {
		if ( obj.state > promise.state.PENDING ) {
			return;
		}

		obj.value = arg;
		obj.state = state;

		if ( !obj.deferred ) {
			promise.delay( function () {
				obj.process();
			});

			obj.deferred = true;
		}

		return obj;
	}
1085661
function finish(ch) {
  ch[STATE] = STATES.ENDED
  let waiting = null
  while (
    (waiting = ch.waiting.shift()) // eslint-disable-line no-cond-assign
  ) {
    waiting()
  }
}
845526
public static void awaitUninterruptibly(CountDownLatch latch) {
    boolean interrupted = false;
    try {
      while (true) {
        try {
          latch.await();
          return;
        } catch (InterruptedException e) {
          interrupted = true;
        }
      }
    } finally {
      if (interrupted) {
        Thread.currentThread().interrupt();
      }
    }
  }
124923
public void blockTillTerminated() {
    while (!runState.compareAndSet(State.IDLE, State.REMOVED)) {
      // wait and retry
      LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10));
      if (Thread.currentThread().isInterrupted()) {
        runState.set(State.REMOVED);
        return;
      }
    }
  }
842614
public static void waitWhileState(final DeviceProxy proxy, final DevState waitState, final long timeout,
	    final long pollingTime) throws DevFailed, TimeoutException {
	final long time0 = System.currentTimeMillis();

	while (proxy.state().equals(waitState)) {
	    if (System.currentTimeMillis() - time0 > timeout) {
		throw new TimeoutException(
			"Stateutilities.waitWhileState : timeout reached while waiting end of state "
				+ TangoConst.Tango_DevStateName[waitState.value()]);
	    }
	    try {
		Thread.sleep(pollingTime);
	    } catch (final InterruptedException e) {
		// ignore
	    }
	}

    }
596298
void waitForReady() {
    if (!ready) {
      writeLock();
      try {
        while (!ready) {
          try {
            cond.await(5000, TimeUnit.MILLISECONDS);
          } catch (InterruptedException ie) {
          }
        }
      } finally {
        writeUnlock();
      }
    }
  }
726735
function uniqStates(states) {
    var seen = {}, a = [], path, i, n;

    for (i = 0, n = states.length; i < n; i++) {
      if (!states[i]) { continue; }
      path = states[i].path();
      if (!seen[path]) {
        a.push(states[i]);
        seen[path] = true;
      }
    }

    return a;
  }
530635
function(state) {
    try {
      state = unescape(state).evalJSON();
      var filterer = $('search').retrieve('filterer');    
      filterer.setSearchValue(state.searchValue);

      (function() {
        $('menu_pane').scrollTop = state.menuScrollOffset;
        $('search_results').scrollTop = state.searchScrollOffset;
      }).defer();
    } catch(error) {
      console.log(error);
      if (!(error instanceof SyntaxError)) throw error;
    }
  }