Removal of two instances of synchronization on Boolean

Adam Domurad adomurad at redhat.com
Thu May 17 13:28:16 PDT 2012


On Thu, 2012-05-17 at 15:48 -0400, Omair Majid wrote:
> On 05/17/2012 03:38 PM, Adam Domurad wrote:
> > Hello all. Tiny patch here to remove two instances of synchronization on
> > Boolean (considered bad practice as typically only two Boolean objects
> > exist).
> > 
> > While I was not entirely sure what should be done about the Boolean
> > synchronization, Deepak's opinion was that the synchronization was not
> > needed, so I submitted this small patch.
> 
> I could be wrong, but seems to me that read() and write() are running in
> different threads. Without some form of synchronization, writes from one
> thread may not be visible to the other thread at all. Making
> shuttingDown a 'volatile boolean' should be sufficient.
> 
> Cheers,
> Omair


Thanks. The adjusted patch is attached. Also, for the subject of another
patch I'm working on, does the comment at the top of the file suggest
the class is named VoidPluginCallRequest or is it just me ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch3.patch
Type: text/x-patch
Size: 1506 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120517/852186ae/patch3.patch 


More information about the distro-pkg-dev mailing list