Remove the threads locking in the dispatchers destruction notification

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
This commit is contained in:
Emmanuele Bassi 2007-08-22 10:12:15 +00:00
parent 0e90acfdeb
commit fa7eb4e5a8

View File

@ -549,13 +549,15 @@ clutter_threads_dispatch_free (gpointer data)
{
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);
}