Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 /** @return the number of stack frames (deprecated) */
 public int countStackFrames() {
   return system.getFrame().getStackSize();
 }
Exemplo n.º 3
0
 /** @return the name */
 public final String getName() {
   return system.getName();
 }
Exemplo n.º 4
0
 /**
  * Set the name of this thread
  *
  * @param name the new name
  */
 public final void setName(String name) {
   checkAccess();
   system.setName(name);
 }
Exemplo n.º 5
0
 /** @return the priority of this thread */
 public final int getPriority() {
   return system.getPriority();
 }
Exemplo n.º 6
0
 /** Resume this thread (deprecated) */
 public final void resume() {
   system.resume();
 }
Exemplo n.º 7
0
 /** Suspend this thread (deprecated) */
 public final void suspend() {
   system.suspend();
 }
Exemplo n.º 8
0
 /** Start execution of this thread */
 public void start() {
   // call start hook of system implementation
   system.start();
 }
Exemplo n.º 9
0
 /**
  * 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);
 }
Exemplo n.º 10
0
 /** @return a reference to the currently executing thread */
 public static Thread currentThread() {
   return org.pjos.common.runtime.Thread.currentThread().getThread();
 }