Tabnine Logo
Thread.start
Code IndexAdd Tabnine to your IDE (free)

How to use
start
method
in
java.lang.Thread

Best Java code snippets using java.lang.Thread.start (Showing top 20 results out of 65,862)

origin: ReactiveX/RxJava

  @Override
  public void execute(Runnable r) {
    new Thread(r).start();
  }
});
origin: ReactiveX/RxJava

  @Override
  public void execute(Runnable r) {
    new Thread(r).start();
  }
}, true);
origin: ReactiveX/RxJava

  @Override
  public void execute(Runnable r) {
    new Thread(r).start();
  }
}, true);
origin: ReactiveX/RxJava

  @Override
  public void execute(Runnable r) {
    new Thread(r).start();
  }
});
origin: ReactiveX/RxJava

  @Override
  public void execute(Runnable r) {
    new Thread(r).start();
  }
}, true);
origin: ReactiveX/RxJava

  @Override
  public void execute(Runnable r) {
    new Thread(r).start();
  }
});
origin: google/guava

 @Override
 public void execute(Runnable command) {
  MoreExecutors.newThread(serviceName(), command).start();
 }
};
origin: google/guava

/** Returns a new started daemon Thread running the given runnable. */
Thread newStartedThread(Runnable runnable) {
 Thread t = new Thread(runnable);
 t.setDaemon(true);
 t.start();
 return t;
}
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Subscriber<? super String> subscriber) {
    subscriber.onSubscribe(new BooleanSubscription());
    new Thread(new Runnable() {
      @Override
      public void run() {
        counter.incrementAndGet();
        subscriber.onNext("one");
        subscriber.onComplete();
      }
    }).start();
  }
}).publish();
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Subscriber<? super String> subscriber) {
    subscriber.onSubscribe(new BooleanSubscription());
    new Thread(new Runnable() {
      @Override
      public void run() {
        counter.incrementAndGet();
        subscriber.onNext("one");
        subscriber.onComplete();
      }
    }).start();
  }
}).cacheWithInitialCapacity(1);
origin: google/guava

 private static void scheduleEnableWrites(BlockingQueue<String> queue, long countdownInMillis) {
  Runnable toRun = new EnableWrites(queue, countdownInMillis);
  // TODO(cpovirk): automatically fail the test if this thread throws
  Thread enablerThread = new Thread(toRun);
  enablerThread.start();
 }
}
origin: google/guava

 private static void scheduleEnableReads(BlockingQueue<String> queue, long countdownInMillis) {
  Runnable toRun = new EnableReads(queue, countdownInMillis);
  // TODO(cpovirk): automatically fail the test if this thread throws
  Thread enablerThread = new Thread(toRun);
  enablerThread.start();
 }
}
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Subscriber<? super String> subscriber) {
    subscriber.onSubscribe(new BooleanSubscription());
    t = new Thread(new Runnable() {
      @Override
      public void run() {
        subscriber.onNext("hello");
        subscriber.onComplete();
      }
    });
    t.start();
  }
}
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Observer<? super String> observer) {
      observer.onSubscribe(Disposables.empty());
      new Thread(new Runnable() {
        @Override
        public void run() {
          counter.incrementAndGet();
          observer.onNext("one");
          observer.onComplete();
        }
      }).start();
  }
}).replay();
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Observer<? super String> observer) {
    observer.onSubscribe(Disposables.empty());
    new Thread(new Runnable() {
      @Override
      public void run() {
        counter.incrementAndGet();
        observer.onNext("one");
        observer.onComplete();
      }
    }).start();
  }
}).publish();
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Observer<? super String> observer) {
      observer.onSubscribe(Disposables.empty());
      new Thread(new Runnable() {
        @Override
        public void run() {
          counter.incrementAndGet();
          observer.onNext("one");
          observer.onComplete();
        }
      }).start();
  }
}).cache();
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Observer<? super String> observer) {
    observer.onSubscribe(Disposables.empty());
    new Thread(new Runnable() {
      @Override
      public void run() {
        counter.incrementAndGet();
        observer.onNext("one");
        observer.onComplete();
      }
    }).start();
  }
}).cacheWithInitialCapacity(1);
origin: ReactiveX/RxJava

  @Override
  public void subscribe(final Observer<? super String> observer) {
    observer.onSubscribe(Disposables.empty());
    t = new Thread(new Runnable() {
      @Override
      public void run() {
        observer.onNext("hello");
        observer.onComplete();
      }
    });
    t.start();
  }
}
origin: google/guava

private TimedThread(long expectedCompletionWaitMillis) {
 completed = new Completion(expectedCompletionWaitMillis);
 thread = new Thread(new JoinTarget(expectedCompletionWaitMillis));
 thread.start();
}
origin: google/guava

public void testJoinWithNoWait() throws InterruptedException {
 Stopwatch stopwatch = Stopwatch.createStarted();
 Thread thread = new Thread(new JoinTarget(15));
 thread.start();
 thread.join();
 assertFalse(thread.isAlive());
 joinUninterruptibly(thread);
 joinUninterruptibly(thread, 0, MILLISECONDS);
 joinUninterruptibly(thread, -42, MILLISECONDS);
 joinUninterruptibly(thread, LONG_DELAY_MS, MILLISECONDS);
 assertTimeNotPassed(stopwatch, LONG_DELAY_MS);
}
java.langThreadstart

Javadoc

Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.

The result is that two threads are running concurrently: the current thread (which returns from the call to the start method) and the other thread (which executes its run method).

It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.

Popular methods of Thread

  • currentThread
  • sleep
    Causes the currently executing thread to sleep (temporarily cease execution) for the specified numbe
  • <init>
    Constructs a new Thread with no Runnable object, the given name and belonging to the ThreadGroup pas
  • getContextClassLoader
    Returns the context ClassLoader for this Thread. The context ClassLoader is provided by the creator
  • interrupt
    Interrupts this thread. Unless the current thread is interrupting itself, which is always permitted,
  • setDaemon
    Marks this thread as either a #isDaemon thread or a user thread. The Java Virtual Machine exits when
  • getName
    Returns this thread's name.
  • join
    Waits at most millis milliseconds plus nanos nanoseconds for this thread to die. This implementatio
  • setContextClassLoader
    Sets the context ClassLoader for this Thread. The context ClassLoader can be set when a thread is cr
  • setName
    Changes the name of this thread to be equal to the argumentname. First the checkAccess method of thi
  • interrupted
    Tests whether the current thread has been interrupted. Theinterrupted status of the thread is cleare
  • getStackTrace
    Returns an array of stack trace elements representing the stack dump of this thread. This method wil
  • interrupted,
  • getStackTrace,
  • getId,
  • isInterrupted,
  • isAlive,
  • setPriority,
  • yield,
  • getThreadGroup,
  • getPriority

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • BoxLayout (javax.swing)
  • JLabel (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now