scheduler.addToReadyQueue(current, false);
scheduler.addToReadyQueue(current, false, getIdString());
    final void reschedule() {        // Unsafe.debug("R");        this.nextThread = null;        try {            // Get the current thread            final VmThread current = currentThread;            this.nextThread = current;            // Process kernel debugger data            if (Unsafe.isKdbEnabled()) {                scheduler.processAllKdbInput();            }            // Dispatch interrupts if we already have an IRQ manager.            final IRQManager irqMgr = this.irqMgr;            if (irqMgr != null) {                irqMgr.dispatchInterrupts(current);            }            // Add the current thread to the ready queue, if the state            // is running.            if (current.isRunning()) {                scheduler.addToReadyQueue(current, false);            } else {                // Screen.debug("<Non-running thread in reschedule "+                // current.getThreadState() + "                // called "+ current.asThread().getName() + "/>");                // Unsafe.die();            }            // Determine the new thread.            // Get the first ready to run thread from the schedule            // and process the scheduler wakeup queue.            final VmThread newThread = scheduler.schedule();            // It no other thread want to run, that means that the idle thread            // has been halted, we give up.            if (newThread == null) {                Unsafe.debug("No Threads to run!\n");                scheduler.dump();                Unsafe.die("No thread to run in reschedule");            }            // Pass newThread onto native code.            this.nextThread = newThread;            final int priority = newThread.priority;            if (priority == lastThreadPriority) {                sameThreadPriorityCount++;                if ((priority > Thread.NORM_PRIORITY)                        && ((sameThreadPriorityCount % 2500) == 0)) {                    Unsafe.debug("Maybe stuck in high priority: ");                    Unsafe.debug(newThread.getName());                    if (sameThreadPriorityCount > 100000) {                        getArchitecture().getStackReader().debugStackTrace(                                current);                        Unsafe.die("Probably deadlock in high priority thread");                    }                }            } else {                lastThreadPriority = priority;                sameThreadPriorityCount = 0;            }        } catch (Throwable ex) {            try {                ex.printStackTrace();            } catch (Throwable ex2) {                Unsafe.debug("Exception in Exception in Scheduler");                /* Ignore */            }            Unsafe.die("Exception in reschedule");        }    }