7155963: Deadlock in SystemFlavorMap.getFlavorsForNative and SunToolkit.awtLock
authorazvegint
Mon, 15 Dec 2014 16:00:53 +0300
changeset 28229 15b31c9a2351
parent 28228 be83f404724d
child 28230 f488c331f610
7155963: Deadlock in SystemFlavorMap.getFlavorsForNative and SunToolkit.awtLock Reviewed-by: ant, serb
jdk/src/java.desktop/unix/classes/sun/awt/X11/XClipboard.java
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XClipboard.java	Thu Dec 11 15:19:12 2014 +0800
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XClipboard.java	Mon Dec 15 16:00:53 2014 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -281,6 +281,11 @@
             }
         }
 
-        checkChange(formats);
+        XToolkit.awtUnlock();
+        try {
+            checkChange(formats);
+        } finally {
+            XToolkit.awtLock();
+        }
     }
 }