mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-18 16:07:50 +02:00
Enable threads in g_type_init()
This means threads will be supported for all gobject libraries/applications and initialized early enough to not cause any problems. This solves the problem of libraries needing threadsafety. Previosly they just called g_threads_init() anyway, which often works but sometimes breaks in unexpected ways. See this thread for more details: http://mail.gnome.org/archives/gtk-devel-list/2009-November/msg00208.html https://bugzilla.gnome.org/show_bug.cgi?id=606775
This commit is contained in:
@@ -48,6 +48,14 @@ However, many libraries above glib does not support late initialization of
|
||||
threads, so doing this should be avoided if possible.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Please note that since version 2.24 the GObject initialization
|
||||
function g_type_init() initializes threads (with a %NULL argument), so
|
||||
most applications, including those using Gtk+ will run with threads
|
||||
enabled. If you want a special thread implementation, make sure you
|
||||
call g_thread_init() before g_type_init() is called.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
After calling g_thread_init(), GLib is completely
|
||||
thread safe (all global data is automatically locked), but individual
|
||||
|
Reference in New Issue
Block a user