This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch [ecj]: Refactor Parking Code + Win32 Implementation
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: Fri, 08 Dec 2006 12:48:01 -0600
- Subject: Re: Patch [ecj]: Refactor Parking Code + Win32 Implementation
- Reply-to: gnustuff at thisiscool dot com
> > ...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/