This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [win32] notifyAll also notifying following wait calls


Tom Tromey wrote:
"Marco" == Marco Trudel <mtrudel@gmx.ch> writes:

Marco> win32-threads.cc has a thread race for notifyAll() and Marco> wait(). Test.java should actually deadlock, but sometimes it Marco> doesn't because the second wait increments blocked_count before Marco> the event is reset and thus will also be called.

I can't really comment on your patch, since I don't know much about
Windows.

Ok, I'll work with it some time and if I don't run into trouble, I'll repost the patch again.


But note that Object.wait() can wake up spuriously. So...

How so? Wouldn't that make the whole wait() notify() mechanism pretty useless?


Marco> mainLock.wait(); // not allowed to be notified

... I think this comment is incorrect.

It is allowed to be notified from the preceding notifyAll() call?



thanks Marco


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]