if (loopcheck++ >= 1000000) break;
  private VM_Thread getRunnableThread() {    VM_Magic.pragmaInline();    for (int i=transferQueue.length(); 0<i; i--) {      transferMutex.lock();      VM_Thread t = transferQueue.dequeue();      transferMutex.unlock();      if (t.isGCThread){	if (trace) VM_Scheduler.trace("VM_Processor", "getRunnableThread: collector thread", t.getIndex());	return t;      } else if (t.beingDispatched && t != VM_Thread.getCurrentThread()) { // thread's stack in use by some OTHER dispatcher	if (trace) VM_Scheduler.trace("VM_Processor", "getRunnableThread: stack in use", t.getIndex());	transferMutex.lock();	transferQueue.enqueue(t);	transferMutex.unlock();	if (processorMode == NATIVE) {		// increase loop counter so this thread will be looked at 		// again - isbeingdispatched goes off when dispatcher stops		// running on the RVM processor, using this thread's stack.		// RARE CASE: the stuck thread has returned from this native		// processor, but being dispatched in the nativeidlethread has not		// yet gone off because its stack is still being used by dispatcher		// on the RVM			i++;		if (VM.VerifyAssertions) VM.assert (t.isNativeIdleThread);	}      } else {	if (trace) VM_Scheduler.trace("VM_Processor", "getRunnableThread: transfer to readyQueue", t.getIndex());	readyQueue.enqueue(t);      }    }    if (!readyQueue.isEmpty()) {      VM_Thread t = readyQueue.dequeue();      if (trace) VM_Scheduler.trace("VM_Processor", "getRunnableThread: readyQueue", t.getIndex());      if (VM.VerifyAssertions) VM.assert(t.beingDispatched == false || t == VM_Thread.getCurrentThread()); // local queue: no other dispatcher should be running on thread's stack      return t;    }    if (ioQueue.isReady()) {      VM_Thread t = ioQueue.dequeue();      if (trace) VM_Scheduler.trace("VM_Processor", "getRunnableThread: ioQueue", t.getIndex());      if (VM.VerifyAssertions) VM.assert(t.beingDispatched == false || t == VM_Thread.getCurrentThread()); // local queue: no other dispatcher should be running on thread's stack      return t;    }    if (!idleQueue.isEmpty()) {      VM_Thread t = idleQueue.dequeue();      if (trace) VM_Scheduler.trace("VM_Processor", "getRunnableThread: idleQueue", t.getIndex());      if (VM.VerifyAssertions) VM.assert(t.beingDispatched == false || t == VM_Thread.getCurrentThread()); // local queue: no other dispatcher should be running on thread's stack      return t;    }    VM.assert(VM.NOT_REACHED); // should never get here (the idle thread should always be: running, on the idleQueue, or (maybe) on the transferQueue)    return null;  }  //-----------------//  //  Load Balancing //  //-----------------//  /**   * Add a thread to this processor's transfer queue.   */   private void transferThread (VM_Thread t) {    if (this != getCurrentProcessor() || t.isGCThread || (t.beingDispatched && t != VM_Thread.getCurrentThread())) {      transferMutex.lock();      transferQueue.enqueue(t);      transferMutex.unlock();    } else if (t.isIdleThread) {