This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to know why call to wait() returns...  RSS feed

 
Pascal Got
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
is there a way to know if you get out out of a call to wait(x) because x as expired or because a notify() was called.
Cheers
Pascal
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No - unless you add other code which sets some state info before you call notify(), or add some code around the wait(). Here's one possibility:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!