7155963: Deadlock in SystemFlavorMap.getFlavorsForNative and SunToolkit.awtLock
Reviewed-by: ant, serb
--- 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();
+ }
}
}