aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/javax
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-26 21:43:20 +0100
committerSven Gothel <[email protected]>2011-02-26 21:43:20 +0100
commit76444dce2b678a7f6769564abac4f8a73f414609 (patch)
tree09358c0a48715c69e7e8f511cf3d9be729177509 /src/nativewindow/classes/javax
parent77546f8968779fbdcfe58f89c6924803642889c7 (diff)
Clean/Fix: Threading Code
- Remove unsafe double checked locking - Annotate safe double checked locking (volatile) - use 'static final' if possible
Diffstat (limited to 'src/nativewindow/classes/javax')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java
index 7112f944d..e7db942e4 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -51,6 +51,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
}
class WindowClosingAdapter extends WindowAdapter {
+ @Override
public void windowClosing(WindowEvent e) {
int op = AWTWindowClosingProtocol.this.getDefaultCloseOperation();
@@ -80,7 +81,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
* @return
*/
public final boolean addClosingListenerOneShot() {
- if(!closingListenerSet) {
+ if(!closingListenerSet) { // volatile: ok
synchronized(closingListenerLock) {
if(!closingListenerSet) {
closingListenerSet=addClosingListenerImpl();
@@ -92,7 +93,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
}
public final boolean removeClosingListener() {
- if(closingListenerSet) {
+ if(closingListenerSet) { // volatile: ok
synchronized(closingListenerLock) {
if(closingListenerSet) {
Window w = AWTMisc.getWindow(comp);