Since the Windows GUI system is assuming multithreadedness, initializing
locks after entering the GUI portion on Windows is likely to cause
problems[1][2], which results many Clutter programs to crash due to
releasing resources that they did not own.
[1]: Multi-threaded use of GTK+ on Win32 in README.win32 of GTK+
source package
[2]: Explanation of Windows GUI system regarding its multithreadness
assumptions-
http://mail.gnome.org/archives/gtk-list/2011-June/msg00005.html
{
g_mutex_init (&clutter_threads_mutex);
+#ifndef CLUTTER_WINDOWING_WIN32
+ /* we don't need nor want locking functions on Windows.here\r
+ * as Windows GUI system assumes multithreadedness\r
+ * see bug: https://bugzilla.gnome.org/show_bug.cgi?id=662071\r
+ */
if (clutter_threads_lock == NULL)
clutter_threads_lock = clutter_threads_impl_lock;
if (clutter_threads_unlock == NULL)
clutter_threads_unlock = clutter_threads_impl_unlock;
+#endif /* CLUTTER_WINDOWING_WIN32 */
}
#define ENVIRONMENT_GROUP "Environment"