0% found this document useful (0 votes)
29 views

JDBC

This code snippet shows how to wait for another thread called "someThread" to finish executing before continuing the code block. A new thread is created anonymously and its run method first calls join on someThread, which pauses the thread's execution until someThread completes. Then any code after the join call will run.

Uploaded by

Vishwajeet Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

JDBC

This code snippet shows how to wait for another thread called "someThread" to finish executing before continuing the code block. A new thread is created anonymously and its run method first calls join on someThread, which pauses the thread's execution until someThread completes. Then any code after the join call will run.

Uploaded by

Vishwajeet Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

new Thread() {

public void run() {


someThread.join(); // someThread is the thread that you're waiting to die
// your block of code
}
}.start();

You might also like