Patch [ecj]: Refactor Parking Code + Win32 Implementation

Mohan Embar gnustuff@thisiscool.com
Fri Dec 8 18:48:00 GMT 2006


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

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/






More information about the Java-patches mailing list