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