changeset 1526:ff78ae1d7429

Experimental change for GTK2... switch to recursive mutexes for the gdk mutex.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 02 Jan 2012 06:25:36 +0000
parents 34ce887be578
children 9bab702bd6c1
files gtk/dw.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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