Chute: sera que eh por que quando a thread faz wait() ela larga os locks?
Marcio Kuchma
This message was edited 1 time. Last update was at 15/03/2005 19:17:02
E tu, Belém-Efrata, pequena demais para figurar como grupo de milhares de Judá, de ti me sairá o que há de reinar em Israel, e cujas origens são desde os tempos antigos, desde os dias da eternidade. Mq 5:2, Miquéias, 750 AC aprox.
Membro desde: 29/04/2003 23:09:15
Mensagens: 4061
Localização: São Paulo
Offline
Direto do javadoc da classe:
public final void wait()
throws InterruptedException
Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. In other words, this method behaves exactly as if it simply performs the call wait(0).
The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method. The thread then waits until it can re-obtain ownership of the monitor and resumes execution.
This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.
Porque é assim, eu não sei.
http://www.kumpera.net/blog/ http://www.mono-project.com/
"Each individual should work for himself. People will not sacrifice themselves for the company. They come to work at the company to enjoy themselves."
Soichiro Honda