Stops the proxy and exits.
The call is synchronous.

@return the read status.
968622
public String exit()
    {
        agent.send(EXIT);
        exit.awaitSilent();
        agent.close();
        return EXITED;
    }
1094527
public long accept() {
        Lock readerLock = context.ctxLock.readLock();
        readerLock.lock();
        try {
            return SSLContext.sessionAccept(context.ctx);
        } finally {
            readerLock.unlock();
        }
    }
45293
public void stop() {
        try {
            safeClose(myServerSocket);
            closeAllConnections();
            myThread.join();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
706138
public void stop() {
		isRunning = false;
		thread.interrupt();
		try {
			closeFileReader();
		} catch (IOException ioe) {
			System.out.println(new LogEntry(Level.CRITICAL, "I/O exception while closing file reader: " + ioe.getMessage(), ioe));
		}
	}
1269542
@Override
    public boolean requestPermissionToFinishRead() {
        boolean rc = true;
        synchronized (this) {
            if ((currentState & FINISH_NOT_ALLOWED_MASK) != 0) {
                rc = false;
            } else {
                currentState = (currentState | READ_FINISHING) & READ_FINISHING_CLEAR_OUT;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "requestPermissionToFinishRead returning " + rc);
        }
        return rc;
    }
1330967
@Override
  public StateConnection onCloseRead()
  {
    ConnectionProtocol request = request();
    
    if (request != null) {
      request.onCloseRead();
    }
    
    _sequenceClose.set(_sequenceRead.get());
    
    if (_sequenceFlush.get() < _sequenceClose.get()) {
      _isClosePending.set(true);
      
      if (_sequenceFlush.get() < _sequenceClose.get()) {
        return StateConnection.CLOSE_READ_S;
      }
      else {
        _isClosePending.set(false);
        
        return StateConnection.CLOSE;
      }
    }
    else {
      return StateConnection.CLOSE;
    }
  }
759302
public synchronized long stop() {

		stopTime = System.currentTimeMillis();
		currentTime = stopTime - startTime;
		started = false;

		return currentTime;
	}
597792
public int readReverse() throws IOException {
		int b;
		do {
			canRead.block(0);
			synchronized (this) {
				if (error != null) throw error;
				if (io == null) throw new IOException("IO closed");
				// check if we reached the beginning of the file
				if (bufferPosInFile == 0 && posInBuffer == minInBuffer) return -1;
				if (posInBuffer == minInBuffer) {
					// we are reading faster than buffering
					if (currentRead != null)
						canRead.restart();
					else
						readBufferBack();
					b = -1;
				} else {
					b = buffer[--posInBuffer] & 0xFF;
					if (currentRead == null && posInBuffer < buffer.length / 2 && bufferPosInFile > 0)
						readBufferBack();
				}
			}
		} while (b == -1);
		return b;
	}
230854
@Override
    public boolean stop() {
        synchronized(MetricCollectorSupport.class) {
            if (uploaderThread != null) {
                uploaderThread.cancel();
                uploaderThread.interrupt();
                uploaderThread = null;
                if (singleton == this) { // defensive check
                    singleton = null;
                }
                return true;
            }
        }
        return false;
    }
961388
private int stop(final String[] args) throws IOException {
    setWorkingDir(args);
    final Path statusFile = getStatusPath();
    int exitStatus = 1;

    // determine the current state of the node
    readStatus(false, statusFile);
    if (this.status != null) {
      // upon reading the status file, request the Cache Server to shutdown
      // if it has not already...
      if (this.status.state != Status.SHUTDOWN) {
        // copy server PID and not use own PID; see bug #39707
        this.status = Status.create(this.baseName, Status.SHUTDOWN_PENDING,
            this.status.pid, statusFile);
        this.status.write();
      }

      // poll the Cache Server for a response to our shutdown request
      // (passes through if the Cache Server has already shutdown)
      pollCacheServerForShutdown(statusFile);

      // after polling, determine the status of the Cache Server one last time
      // and determine how to exit...
      if (this.status.state == Status.SHUTDOWN) {
        System.out.println(MessageFormat.format(LAUNCHER_STOPPED,
            this.baseName, getHostNameAndDir()));
        Status.delete(statusFile);
        exitStatus = 0;
      } else {
        System.out.println(MessageFormat.format(LAUNCHER_TIMEOUT_WAITING_FOR_SHUTDOWN,
            this.baseName, this.hostName, this.status));
      }
    } else if (Files.exists(statusFile)) {
      throw new IllegalStateException(MessageFormat.format(
          LAUNCHER_NO_AVAILABLE_STATUS, this.statusName));
    } else {
      System.out.println(MessageFormat.format(LAUNCHER_NO_STATUS_FILE,
          this.workingDir, this.hostName));
    }
    return exitStatus;
  }
1188400
def stop(self):
        
        if self.status in (TransferState.PAUSED, TransferState.RUNNING):
            self._stop_signal = True
            self.join()
            self._status = TransferState.STOPPED
            if self._callback:
                return self._callback(self._status)
        else:
            raise SbgError(
                'Can not stop. Download not in PAUSED or RUNNING state.'
            )
799336
public Metrics terminate()
  {
    if (!terminated)
    {

      logger.debug("Total milliseconds waiting for chunks: {}, " +
                   "Total memory used: {}, total download time: {} millisec, " +
                   "total parsing time: {} milliseconds, total chunks: {}",
                   numberMillisWaitingForChunks,
                   Runtime.getRuntime().totalMemory(), totalMillisDownloadingChunks.get(),
                   totalMillisParsingChunks.get(), chunks.size());

      if (executor != null)
      {
        executor.shutdownNow();
        executor = null;
      }
      chunks = null;
      chunkDataCache.clear();

      terminated = true;
      return new Metrics();
    }
    return null;
  }
160290
public void read()
  {
    StateInPipe stateOld;
    StateInPipe stateNew;
    
    do {
      stateOld = _stateInRef.get();
      stateNew = stateOld.toActive();
    } while (! _stateInRef.compareAndSet(stateOld, stateNew));
    
    while (stateNew.isActive()) {
      readPipe();
      
      wakeOut();
      
      do {
        stateOld = _stateInRef.get();
        stateNew = stateOld.toIdle();
      } while (! _stateInRef.compareAndSet(stateOld, stateNew));
    }
    
    if (_stateInRef.get().isClosed()) {
      StateOutPipe outStateOld = _stateOutRef.getAndSet(StateOutPipe.CLOSE);
      
      if (! outStateOld.isClosed()) {
        _outFlow.cancel();
      }
    }
  }
728207
public Optional<String> stop() {
        final LinkedList<String> uuids = context.get();
        if (!uuids.isEmpty()) {
            return Optional.of(uuids.pop());
        }
        return Optional.empty();
    }
768928
public ReturnCode stop() {
        System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStopping"), serverName));

        // Use initialized bootstrap configuration to find the server lock file.
        ServerLock serverLock = ServerLock.createTestLock(bootProps);

        // we can not pre-test the server: on some platforms, the server lock file
        // can be deleted, which means waiting to see if it is there leads to
        // an abandoned server.
        ReturnCode stopRc = ReturnCode.STOP_ACTION;

        // The lock file may have been (erroneously) deleted: this can happen on linux
        boolean lockExists = serverLock.lockFileExists();

        if (lockExists) {
            // If the lock exists, check quickly to see if the process is holding it.
            if (serverLock.testServerRunning()) {
                // we need to tell the server to stop...
                ServerCommandClient scc = new ServerCommandClient(bootProps);

                if (scc.isValid()) {
                    stopRc = scc.stopServer(launchArgs.getOption("force") != null);
                } else {
                    // we can't communicate to the server...
                    stopRc = ReturnCode.ERROR_SERVER_STOP;
                }
            } else {
                // nope: lock not held, we're already stopped
                stopRc = ReturnCode.REDUNDANT_ACTION_STATUS;
            }
        } else {
            // no lock file: we assume the server is not running, we have nothing to do.
            stopRc = ReturnCode.REDUNDANT_ACTION_STATUS;
        }

        // If the lock file existed before we attempted to stop the server,
        // wait until we can obtain the server lock file (because the server process has stopped)
        if (stopRc == ReturnCode.OK && lockExists) {
            stopRc = serverLock.waitForStop();
        }

        if (stopRc == ReturnCode.OK) {
            String pid = getPID();
            if (pid != null) {
                stopRc = waitForProcessStop(pid);
            }
        }

        if (stopRc == ReturnCode.OK) {
            System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStopped"), serverName));
        } else if (stopRc == ReturnCode.REDUNDANT_ACTION_STATUS) {
            System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverNotRunning"), serverName));
        } else if (stopRc == ReturnCode.SERVER_COMMAND_PORT_DISABLED_STATUS) {
            System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("error.serverStopCommandPortDisabled"), serverName));
        } else {
            System.out.println(MessageFormat.format(BootstrapConstants.messages.getString("info.serverStopException"), serverName));
        }

        return stopRc;
    }
746496
public void close() {
    clientLock.writeLock().lock();
    try {
      if (client != null) {
        RPC.stopProxy(client);
        client = null;
      }
    } finally {
      clientLock.writeLock().unlock();
    }
  }
630500
@Write(consumes = {})
    public Object stop() {
        try {
            return message;
        } finally {
            Thread thread = new Thread(this::stopServer);
            thread.setContextClassLoader(getClass().getClassLoader());
            thread.start();
        }
    }