hi guys i was wonderig what the best way to stop (kill) a thread any ideas ?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
hi guys i was wonderig what the best way to stop (kill) a thread any ideas ?
In the thread, test if a flag is set asking the thread to exit and exit/return.
viper_07 (July 14th, 2011)
thanks mate thats what i used in the end
or you could do something like this:
as in, set your thread to null and your stop flag to true... just to double make sure...public void stop() { thread = null; stop = true; }
What does setting the variable: thread to null do?