Java SE/isAlive(), join() 썸네일형 리스트형 isAlive(), join() // Create and start a thread Thread thread = new MyThread(); thread.start(); // Check if the thread has finished in a non-blocking way if (thread.isAlive()) { // Thread has not finished } else { // Finished } // Wait for the thread to finish but don't wait longer than a // specified time long delayMillis = 5000; // 5 seconds try { thread.join(delayMillis); if (thread.isAlive()) { // Timeout occu.. 더보기 이전 1 다음