Patch [ecj]: Refactor Parking Code + Win32 Implementation

Andrew Haley aph@redhat.com
Fri Dec 8 18:53:00 GMT 2006


Mohan Embar writes:
 > > > ...why do you lock and unlock the mutex outside of the if statement
 > > > rather than within it?
 > >
 > >I have no idea.  Perhaps at this point my best defence would be to
 > >plead insanity...
 > 
 > I can relate. I was half-asleep last night when I realized that
 > the use I was making of the semaphore had exactly the same semantics
 > as an event. I could have done a drop-in replacement and kept my
 > old version (without compare_and_exchange), except that I read somewhere
 > that these calls are very expensive.
 > 
 > Thanks again for reviewing this. If you want me to put the mutex
 > locking and unlocking inside the if statement and rerun my test on
 > FC5, let me know.

That would be interesting.  If it works, feel free to commit.

Andrew.



More information about the Java-patches mailing list