/** * Set the priority of this thread * * @param newPriority the new priority */ public final void setPriority(int newPriority) { // checkAccess(); if (newPriority < MIN_PRIORITY || newPriority > MAX_PRIORITY) { throw new IllegalArgumentException(); } int priority = Math.min(newPriority, group.getMaxPriority()); system.setPriority(priority); }
/** @return the number of stack frames (deprecated) */ public int countStackFrames() { return system.getFrame().getStackSize(); }
/** @return the name */ public final String getName() { return system.getName(); }
/** * Set the name of this thread * * @param name the new name */ public final void setName(String name) { checkAccess(); system.setName(name); }
/** @return the priority of this thread */ public final int getPriority() { return system.getPriority(); }
/** Resume this thread (deprecated) */ public final void resume() { system.resume(); }
/** Suspend this thread (deprecated) */ public final void suspend() { system.suspend(); }
/** Start execution of this thread */ public void start() { // call start hook of system implementation system.start(); }
/** * Put the currently executing thread to sleep * * @param millis the number of milliseconds to sleep * @param nanos the number of nanoseconds to sleep * @throws InterruptedException if interrupted */ public static void sleep(long millis, int nanos) throws InterruptedException { if (nanos < 0 || nanos > 999999) { throw new IllegalArgumentException(); } org.pjos.common.runtime.Thread.sleep(millis, nanos); }
/** @return a reference to the currently executing thread */ public static Thread currentThread() { return org.pjos.common.runtime.Thread.currentThread().getThread(); }