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 14. Waiting for the Full Timeout

IN THIS CHAPTER

In Java, two threads can communicate with each other through the wait-notify mechanism (see Chapter 8, "Inter-thread Communication"). When a thread invokes one of the wait() methods of Object, an optional timeout value can be specified. The thread does not return from the wait(long msTimeout) call until it is notified by another thread, the specified millisecond timeout has elapsed, or it is interrupted. It is obvious when it has been interrupted as an InterruptedException is thrown. But other than that, wait() does not return any information as to whether it was notified or just timed ...

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