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