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

How to use
join
method
in
java.lang.Thread

Best Java code snippets using java.lang.Thread.join (Showing top 20 results out of 22,194)

origin: ReactiveX/RxJava

public void waitToFinish() {
  try {
    t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
origin: ReactiveX/RxJava

  public void waitToFinish() {
    try {
      t.join();
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: ReactiveX/RxJava

public void waitToFinish() {
  try {
    t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
origin: ReactiveX/RxJava

  public void waitToFinish() {
    try {
      t.join();
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: ReactiveX/RxJava

  void waitForThreadDone() throws InterruptedException {
    threadHasStarted.await();
    t.join();
  }
}
origin: ReactiveX/RxJava

public void waitToFinish() {
  try {
    t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
origin: ReactiveX/RxJava

  public void waitToFinish() {
    try {
      t.join();
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: ReactiveX/RxJava

  public void waitToFinish() {
    try {
      t.join();
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: ReactiveX/RxJava

  void waitForThreadDone() throws InterruptedException {
    threadHasStarted.await();
    t.join();
  }
}
origin: ReactiveX/RxJava

public void waitToFinish() {
  try {
    t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
}
origin: google/guava

 synchronized void shutdown() throws InterruptedException {
  for (Thread hook : hooks) {
   hook.start();
  }
  for (Thread hook : hooks) {
   hook.join();
  }
 }
}
origin: ReactiveX/RxJava

@Test
public void testMergeArrayWithThreading() {
  final TestASynchronousObservable o1 = new TestASynchronousObservable();
  final TestASynchronousObservable o2 = new TestASynchronousObservable();
  Observable<String> m = Observable.mergeDelayError(Observable.unsafeCreate(o1), Observable.unsafeCreate(o2));
  m.subscribe(stringObserver);
  try {
    o1.t.join();
    o2.t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
  verify(stringObserver, never()).onError(any(Throwable.class));
  verify(stringObserver, times(2)).onNext("hello");
  verify(stringObserver, times(1)).onComplete();
}
origin: ReactiveX/RxJava

@Test
public void testMergeArrayWithThreading() {
  final TestASynchronousFlowable f1 = new TestASynchronousFlowable();
  final TestASynchronousFlowable f2 = new TestASynchronousFlowable();
  Flowable<String> m = Flowable.mergeDelayError(Flowable.unsafeCreate(f1), Flowable.unsafeCreate(f2));
  m.subscribe(stringSubscriber);
  try {
    f1.t.join();
    f2.t.join();
  } catch (InterruptedException e) {
    throw new RuntimeException(e);
  }
  verify(stringSubscriber, never()).onError(any(Throwable.class));
  verify(stringSubscriber, times(2)).onNext("hello");
  verify(stringSubscriber, times(1)).onComplete();
}
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);
}
origin: google/guava

public void testServiceThrowOnShutDown() throws Exception {
 ThrowOnShutDown service = new ThrowOnShutDown();
 service.startAsync().awaitRunning();
 assertEquals(Service.State.RUNNING, service.state());
 service.stopAsync();
 enterRun.countDown();
 executionThread.join();
 assertEquals(Service.State.FAILED, service.state());
 assertThat(service.failureCause()).hasMessageThat().isEqualTo("kaboom!");
}
origin: google/guava

public void testServiceThrowOnRun() throws Exception {
 ThrowOnRunService service = new ThrowOnRunService();
 service.startAsync();
 try {
  service.awaitTerminated();
  fail();
 } catch (IllegalStateException expected) {
  executionThread.join();
  assertThat(expected).hasCauseThat().isEqualTo(service.failureCause());
  assertThat(expected).hasCauseThat().hasMessageThat().isEqualTo("kaboom!");
 }
 assertTrue(service.shutDownCalled);
 assertEquals(Service.State.FAILED, service.state());
}
origin: google/guava

public void testServiceStartStop() throws Exception {
 WaitOnRunService service = new WaitOnRunService();
 assertFalse(service.startUpCalled);
 service.startAsync().awaitRunning();
 assertTrue(service.startUpCalled);
 assertEquals(Service.State.RUNNING, service.state());
 enterRun.await(); // to avoid stopping the service until run() is invoked
 service.stopAsync().awaitTerminated();
 assertTrue(service.shutDownCalled);
 assertEquals(Service.State.TERMINATED, service.state());
 executionThread.join();
}
origin: google/guava

public void testServiceStopIdempotence() throws Exception {
 WaitOnRunService service = new WaitOnRunService();
 service.startAsync().awaitRunning();
 enterRun.await(); // to avoid stopping the service until run() is invoked
 service.stopAsync();
 service.stopAsync();
 service.stopAsync().awaitTerminated();
 assertEquals(Service.State.TERMINATED, service.state());
 service.stopAsync().awaitTerminated();
 assertEquals(Service.State.TERMINATED, service.state());
 executionThread.join();
}
origin: google/guava

public void testServiceExitingOnItsOwn() throws Exception {
 WaitOnRunService service = new WaitOnRunService();
 service.expectedShutdownState = Service.State.RUNNING;
 service.startAsync().awaitRunning();
 assertTrue(service.startUpCalled);
 assertEquals(Service.State.RUNNING, service.state());
 exitRun.countDown(); // the service will exit voluntarily
 executionThread.join();
 assertTrue(service.shutDownCalled);
 assertEquals(Service.State.TERMINATED, service.state());
 service.stopAsync().awaitTerminated(); // no-op
 assertEquals(Service.State.TERMINATED, service.state());
 assertTrue(service.shutDownCalled);
}
origin: google/guava

public void testThreadedServiceStopIdempotenceAfterWait() throws Throwable {
 ThreadedService service = new ThreadedService();
 service.startAsync().awaitRunning();
 assertEquals(State.RUNNING, service.state());
 service.awaitRunChecks();
 service.stopAsync().awaitTerminated();
 service.stopAsync();
 assertEquals(State.TERMINATED, service.state());
 executionThread.join();
 throwIfSet(thrownByExecutionThread);
}
java.langThreadjoin

Javadoc

Waits for this thread to die.

An invocation of this method behaves in exactly the same way as the invocation

#join(long) (0)

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
  • start
    Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread
  • 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.
  • 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
  • Best IntelliJ plugins
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