GNOME Bugzilla – Bug 682473
Deadlock when using org.gnome.gtk.Application
Last modified: 2012-09-02 12:56:37 UTC
Created attachment 222150 [details] Code to reproduce When using the brand new application calling GTK from another thread will make it block. I hava attached a code to reproduce the bug. So basically, the bindings do not look to be thread-safe while using org.gnome.gtk.Application. The bug does not appear if the code uses the classic Gtk.main(). Here is the thread state when trying to call a GTK method of the attachment. "Thread-0" prio=10 tid=0x00007f9798308800 nid=0x126d waiting for monitor entry [0x00007f979c10f000] java.lang.Thread.State: BLOCKED (on object monitor) at org.gnome.gtk.GtkLabel.setLabel(GtkLabel.java:161) - waiting to lock <0x00000000ebcfcaf8> (a org.gnome.gdk.Gdk$Lock) at org.gnome.gtk.Label.setLabel(Label.java:114) at DeadlockExample$Worker.run(DeadlockExample.java:22)
Yeah, duplicated in Slashtime. Bloody hell. GTK thread safety is deprecated and shortly to be removed; it looks like they didn't implement releasing the GDK lock in g_application_run() the way they do in gtk_main(). AfC