<AWT Dev> RFR: JDK-8244088: [Regression] Switch of Gnome theme ends up in deadlocked UI

Jayashree S Kumar github.com+31532647+jaysk1 at openjdk.java.net
Mon Nov 9 06:28:55 UTC 2020


On Thu, 5 Nov 2020 01:44:30 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Issue
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8244088
>> 
>> Problem
>> 
>> While using GTK3 java implementation,  User sees a deadlock issue in UI while trying to switch themes in gnome-tweak-tool.
>
> src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKEngine.c line 353:
> 
>> 351:         JNIEnv *env, jobject this)
>> 352: {
>> 353:     // Note that gtk->flush_event_loop takes care of locks (7053002)
> 
> Different people used these methods (gdk_threads_enter/gdk_threads_leave) here twice which caused two regressions. Looks like the comment about locks is not enough. Could you please update the comment and state that gdk_threads_enter/gdk_threads_leave must not be used here?

@mrserb: Yes will add the additional comment here. 

Like you have rightly said, Yes there are 2 regression here: 
1. For GTK3's g_main_context_iteration they have included an extra lock (gdk_threads_enter/gdk_threads_leave) which was causing a deadlock
2.  The definition of g_main_context_iteration module in new “gtk3_interface.h” is defined using a single parameter causing the hang in XToolkit_waitForEvents 

So
1. In Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1switch_1theme () method removed the extra lock. 
2. Corrected the g_main_context_iteration module definaition accordingly https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-main-context-iteration

-------------

PR: https://git.openjdk.java.net/jdk/pull/932


More information about the awt-dev mailing list