# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1325485536 0 # Node ID ff78ae1d74291fb568ac0324c2d9703bea592e50 # Parent 34ce887be5784c6c51b8ee187677b65959c9cc1f Experimental change for GTK2... switch to recursive mutexes for the gdk mutex. diff -r 34ce887be578 -r ff78ae1d7429 gtk/dw.c --- a/gtk/dw.c Mon Jan 02 00:20:17 2012 +0000 +++ b/gtk/dw.c Mon Jan 02 06:25:36 2012 +0000 @@ -2070,6 +2070,18 @@ } #endif +static GStaticRecMutex _dw_gdk_lock; + +static void _dw_gdk_lock_enter(void) +{ + g_static_rec_mutex_lock(&_dw_gdk_lock); +} + +static void _dw_gdk_lock_leave(void) +{ + g_static_rec_mutex_unlock(&_dw_gdk_lock); +} + /* * Initializes the Dynamic Windows engine. * Parameters: @@ -2131,6 +2143,10 @@ g_thread_init(NULL); #endif #if GTK_MAJOR_VERSION > 1 + g_static_rec_mutex_init(&_dw_gdk_lock); + + gdk_threads_set_lock_functions(G_CALLBACK(_dw_gdk_lock_enter), G_CALLBACK(_dw_gdk_lock_leave)); + gdk_threads_init(); #endif