• 1 reply
  • Latest Post - ‏2007-12-26T19:45:32Z by SystemAdmin
1240 Posts

Pinned topic What happens to waiting thread if notify() is not called?

‏2007-12-25T16:41:58Z |
If thread_A waits on thread_B using the method thread_B.wait() and if thread_B does not call notify(), shouldn't thread_A wait forever? (assuming that thread_A gets to execute first and reaches the wait() method before thread_B gets to run)

However when I ran a sample program I saw something other than what I expected (like said above). I saw that thread_B completed execution, then thread_A completed execution!

Can anyone please explain?

Updated on 2007-12-26T19:45:32Z at 2007-12-26T19:45:32Z by SystemAdmin