예제 #1
0
  /**
   * Starts the new Thread of execution. The <code>run()</code> method of the receiver will be
   * called by the receiver Thread itself (and not the Thread calling <code>start()</code>).
   *
   * @throws IllegalThreadStateException - if this thread has already started.
   * @see Thread#run
   */
  public synchronized void start() {
    checkNotStarted();

    hasBeenStarted = true;

    VMThread.create(this, stackSize);
  }
예제 #2
0
 /**
  * Marks this thread as a daemon thread. A daemon thread only runs as long as there are non-daemon
  * threads running. When the last non-daemon thread ends, the runtime will exit. This is not
  * normally relevant to applications with a UI.
  *
  * @throws IllegalThreadStateException - if this thread has already started.
  */
 public final void setDaemon(boolean isDaemon) {
   checkNotStarted();
   if (vmThread == null) {
     daemon = isDaemon;
   }
 }