O'Reilly logo

Java Thread Programming by Paul Hyde

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. The SureStop Utility

IN THIS CHAPTER

Although the stop() method on the class Thread has been deprecated as of JDK 1.2, there are still times when it can be used as a last resort to get a thread to die. In this chapter, I'll present the SureStop class, which can be used to monitor a thread for a period of time. If the thread is still alive after the specified period of time has elapsed, SureStop will invoke stop() on it to ensure that it finally dies.

Guidelines for Using SureStop

The stop() method on Thread has been deprecated for very good reasons (see Chapter 5, "Gracefully Stopping Threads"). SureStop should only be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required