Thread.currentThread().yield();
Thread.yield();
  private void connectInternal(InetAddress remoteAddr, int remotePort,                                int timeoutMillis) throws IOException {    int rc = -1;    double totalWaitTimeSeconds = (timeoutMillis > 0)      ? ((double) timeoutMillis) / 1000.0      : VM_ThreadEventConstants.WAIT_INFINITE;    byte[] ip = remoteAddr.getAddress();            int family = java.net.JikesRVMSupport.getFamily(remoteAddr);           int address;    address = ip[3] & 0xff;    address |= ((ip[2] << BITS_IN_BYTE) & 0xff00);    address |= ((ip[1] << (2*BITS_IN_BYTE)) & 0xff0000);    address |= ((ip[0] << (3*BITS_IN_BYTE)) & 0xff000000);             while (rc < 0) {      VM_ThreadIOQueue.selectInProgressMutex.lock();      rc = VM_SysCall.sysNetSocketConnect(native_fd,                                           family,                                          address,                                          remotePort);      VM_ThreadIOQueue.selectInProgressMutex.unlock();      switch (rc) {      case 0 : // success        this.address = remoteAddr;        this.port = remotePort;        break;                      case -1 : // operation interrupted by timer tick - retry        Thread.currentThread().yield();        break;                   case -2 :  // operation would have blocked        VM_ThreadIOWaitData waitData =           VM_Wait.ioWaitWrite(native_fd, totalWaitTimeSeconds);        checkIoWaitWrite(waitData);        break;      case -4 : // errno was ECONNREFUSED        throw new ConnectException("Connection refused");      case -5 : // errno was EHOSTUNREACH        throw new NoRouteToHostException();                      case -3 :      default :        throw new IOException("rc="+rc);      }    }  } 