The GLib main loop allows destroying sources while still in the dispatcher
function, so whether the Clutter threading lock is being held or not is
actually unpredictable by the library. This might be fixed in GLib, so we
just do what GTK+ does for the time being and wait.
See bug: http://bugzilla.gnome.org/show_bug.cgi?id=459555
{
ClutterThreadsDispatch *dispatch = data;
- clutter_threads_enter ();
-
+ /* XXX - we cannot hold the thread lock here because the main loop
+ * might destroy a source while still in the dispatcher function; so
+ * knowing whether the lock is being held or not is not known a priori.
+ *
+ * see bug: http://bugzilla.gnome.org/show_bug.cgi?id=459555
+ */
if (dispatch->notify)
dispatch->notify (dispatch->data);
- clutter_threads_leave ();
-
g_slice_free (ClutterThreadsDispatch, dispatch);
}