GNOME Bugzilla – Bug 793124
Remove gdk_threads_* API
Last modified: 2018-02-05 14:27:06 UTC
- The API to mark critical sections is deprecated. - Marking critical sections is not portable - We only ever guaranteed that GTK works from a single thread Now that we're bumping API, it's time to let this old API go. Branch: https://git.gnome.org/browse/gtk+/log/?h=wip/no-more-gdk-threads
Created attachment 367826 [details] [review] Replace gdk_threads_add_idle* with g_idle_add() The main GDK thread lock is not portable and deprecated. The only reason why gdk_threads_add_idle() and gdk_threads_add_idle_full() exist is to allow invoking a callback with the GDK lock held, in case 3rd party libraries still use the deprecated gdk_threads_enter()/gdk_threads_leave() API. Since we're removing the GDK lock, and we're releasing a new major API, such code cannot exist any more; this means we can use the GLib API for installing idle callbacks.
Created attachment 367827 [details] [review] Replace gdk_threads_add_timeout* with g_timeout_add() The main GDK thread lock is not portable and deprecated. The only reason why gdk_threads_add_timeout() and gdk_threads_add_timeout_full() exist is to allow invoking a callback with the GDK lock held, in case 3rd party libraries still use the deprecated gdk_threads_enter()/gdk_threads_leave() API. Since we're removing the GDK lock, and we're releasing a new major API, such code cannot exist any more; this means we can use the GLib API for installing timeout callbacks.
Created attachment 367828 [details] [review] Drop the Big GDK Lock GDK has a lock to mark critical sections inside the backends. Additionally, code that would re-enter into the GTK main loop was supposed to hold the lock. Back in the Good Old Days™ this was guaranteed to kind of work only on the X11 backend, and would cause a neat explosion on any other GDK backend. During GTK+ 3.x we deprecated the API to enter and leave the critical sections, and now we can remove all the internal uses of the lock, since external API that uses GTK+ 4.x won't be able to hold the GDK lock.
Created attachment 367829 [details] [review] Remove all gdk_threads_* entry points Now that we don't use them anywhere, it's time for them to go.
Looks all good to me.
The branch was merged into master.