jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java
changeset 38981 9521cb19e297
parent 28059 e576535359cc
child 40444 afabcfc2f3ef
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Mon May 16 22:57:40 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java	Wed May 18 20:40:17 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,7 +65,7 @@
 
     // DEVICE STATE
 
-    private boolean open          = false;
+    private volatile boolean open;
     private int openRefCount;
 
     /** List of Receivers and Transmitters that opened the device implicitely.
@@ -75,7 +75,7 @@
     /**
      * This is the device handle returned from native code
      */
-    protected long id                   = 0;
+    protected volatile long id;
 
 
 
@@ -479,7 +479,7 @@
         (which opens the device implicitely).
      */
     abstract class AbstractReceiver implements MidiDeviceReceiver {
-        private boolean open = true;
+        private volatile boolean open = true;
 
 
         /** Deliver a MidiMessage.