Results 1 to 3 of 3
Thread: Dead threads
- 12-19-2010, 02:08 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 41
- Rep Power
- 0
- 12-19-2010, 02:22 PM #2
Member
- Join Date
- Dec 2010
- Location
- Nova Scotia, Canada
- Posts
- 2
- Rep Power
- 0
Hey,
I'm pretty sure you have to start a new one or you get an IllegalThreadStateException.
- 12-19-2010, 02:26 PM #3
When a thread is ended you need to create a new one.
But if you have a runnable set, you can use that one again.
Java Code:public class theClass implements Runnable { public theClass() { Thread t = new Thread(this); t.start(); while(t.isAlive()); t = new Thread(this); t.start(); } public void run() { // Here inside the Thread } public static void main(String... args) { new theClass(); } }
Last edited by Dennis; 12-19-2010 at 02:28 PM.
Similar Threads
-
Restarting dead threads
By DC200 in forum Threads and SynchronizationReplies: 3Last Post: 12-03-2010, 11:09 PM -
Threads
By Tanuck in forum New To JavaReplies: 5Last Post: 09-21-2010, 03:44 AM -
GUI and Threads
By rp181 in forum Threads and SynchronizationReplies: 1Last Post: 10-10-2009, 09:39 PM -
Using threads
By Java Tip in forum Java TipReplies: 0Last Post: 12-11-2007, 11:25 AM -
Threads
By one198 in forum Threads and SynchronizationReplies: 1Last Post: 11-20-2007, 07:15 PM
Bookmarks