GNOME Bugzilla – Bug 398783
Timeouts are not thread-safe
Last modified: 2017-07-29 19:04:41 UTC
Any gtk+ operation within a timeout should be wrapped with GDK_THREADS_{ENTER,LEAVE} (the same go for signals handlers as the client may do it's own gtk+ operations) - this effectively means all timeouts should be so wrapped. Gtk+2.12 has the addition of gdk_threads_add_{idle,timeout} which automatically wraps the dispatch function with GDK_THREADS_{ENTER,LEAVE} *and* handles the race condition between signal emission and object destruction. Unfortunately, gtk+2.12 is the future [but not too distant]. Should we, at that time, up the minimum require version of Gtk+ (and glib) and fixup all the obsolete code and implement all the pending features that depend upon a more recent Gtk+?
I don't have any problem with waiting for gtk 2.12 and then requiring it.
Having moved the display/process timeouts from per-terminal to a global the major thread-safety issues are already addressed. Which leaves the cursor blink timeout.
If we used gdk_threads_add_*, then in process_timeout and update_repeat_timeout, the "if (again)... " code blocks would be inside the GDK_THREADS_ENTER/LEAVE block, while they're currently outside of them...
What's the conclusion here?
Obsolete?
Yes, obsolete, esp since gdk_threads_enter/leave are deprecated. Also, vte doesn't use threads anyway.