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