Bug 662071-[Win32]-Don't init the Big Clutter Lock

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
This commit is contained in:
Chun-wei Fan 2011-10-25 00:13:53 +08:00
parent 0f9eded1c3
commit 7c6038d77b

View File

@ -215,11 +215,17 @@ clutter_threads_init_default (void)
{ {
g_mutex_init (&clutter_threads_mutex); g_mutex_init (&clutter_threads_mutex);
#ifndef CLUTTER_WINDOWING_WIN32
/* we don't need nor want locking functions on Windows.here
* as Windows GUI system assumes multithreadedness
* see bug: https://bugzilla.gnome.org/show_bug.cgi?id=662071
*/
if (clutter_threads_lock == NULL) if (clutter_threads_lock == NULL)
clutter_threads_lock = clutter_threads_impl_lock; clutter_threads_lock = clutter_threads_impl_lock;
if (clutter_threads_unlock == NULL) if (clutter_threads_unlock == NULL)
clutter_threads_unlock = clutter_threads_impl_unlock; clutter_threads_unlock = clutter_threads_impl_unlock;
#endif /* CLUTTER_WINDOWING_WIN32 */
} }
#define ENVIRONMENT_GROUP "Environment" #define ENVIRONMENT_GROUP "Environment"