Java wait and notifyAll: IllegalMonitorStateException

前端 未结 1 1446
一整个雨季
一整个雨季 2021-01-25 21:05

I am Java newbie (and RoR developer).

I have a simple program. Ball is shared amont players. Ball should be passed to random Player.

Ok here goes the code:

相关标签:
1条回答
  • 2021-01-25 22:02

    You're waiting on the this monitor without having synchronized on it; you need to wait on ball instead

    0 讨论(0)
提交回复
热议问题