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


>>>>> "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.

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

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

... I think this comment is incorrect.

Tom


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