It's been some time since I worked with java, and it seems that since I last worked with it, stop
and destroy
have been deprecated on threads. This is annoying because it means that I can't create anonymous classes to do basic threaded work like so:
final Integer finChannelId = channelId;
Thread thread = new Thread() {
public void run() {
while (true) {
System.out.println("I'm doing work on " + finChannelId);
}
}
};
thread.start();
// Go off and do something else for a while.
thread.stop();
Is this pattern simply no longer valid? Do I need to create an explicit class now for every tiny worker thread?