diff options
author | Adam Domurad <[email protected]> | 2012-05-18 09:27:24 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-05-18 09:27:24 -0400 |
commit | 34995dfe086e30267dd367f65eaa45144235b069 (patch) | |
tree | b8a006c5dfcadc92a760ac467938278b8c0b05e5 /plugin/icedteanp/java | |
parent | b42384fe344b0af2a54eb00735f7d59b6ba1ab6e (diff) |
Removal of synchronization on Boolean in PluginStreamHandler.
Synchronization on Boolean is dangerous and was unnecessary in this context.
As well, the Boolean flag that was being used during shut down was changed
to a volatile boolean so changes could be seen without synchronization.
Diffstat (limited to 'plugin/icedteanp/java')
-rw-r--r-- | plugin/icedteanp/java/sun/applet/PluginStreamHandler.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java b/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java index c8a4aec..0bb1f01 100644 --- a/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java +++ b/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java @@ -59,7 +59,7 @@ public class PluginStreamHandler { private JavaConsole console = new JavaConsole(); private PluginMessageConsumer consumer; - private Boolean shuttingDown = false; + private volatile boolean shuttingDown = false; public PluginStreamHandler(InputStream inputstream, OutputStream outputstream) @@ -322,9 +322,7 @@ public class PluginStreamHandler { PluginDebug.debug(" PIPE: appletviewer read: ", message); if (message == null || message.equals("shutdown")) { - synchronized (shuttingDown) { - shuttingDown = true; - } + shuttingDown = true; try { // Close input/output channels to plugin. pluginInputReader.close(); @@ -362,10 +360,8 @@ public class PluginStreamHandler { } catch (IOException e) { // if we are shutting down, ignore write failures as // pipe may have closed - synchronized (shuttingDown) { - if (!shuttingDown) { - e.printStackTrace(); - } + if (!shuttingDown) { + e.printStackTrace(); } // either ways, if the pipe is broken, there is nothing |