Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Question  RSS feed

 
Mathew Kuruvilla
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose I have a synchronized method which calls wait, but no other methods in the program calls notify or notifyAll, does it wait forever? Or is there some kind of timeout mechanism for wait.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consult the API. wait(long), and wait(long, int) are suitable.
Aslo you can interrupt a waiting thread
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!