comparison gtk/dw.c @ 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 9d342b67eed5
children 5facb5380944
comparison
equal deleted inserted replaced
1525:34ce887be578 1526:ff78ae1d7429
2068 # endif 2068 # endif
2069 } 2069 }
2070 } 2070 }
2071 #endif 2071 #endif
2072 2072
2073 static GStaticRecMutex _dw_gdk_lock;
2074
2075 static void _dw_gdk_lock_enter(void)
2076 {
2077 g_static_rec_mutex_lock(&_dw_gdk_lock);
2078 }
2079
2080 static void _dw_gdk_lock_leave(void)
2081 {
2082 g_static_rec_mutex_unlock(&_dw_gdk_lock);
2083 }
2084
2073 /* 2085 /*
2074 * Initializes the Dynamic Windows engine. 2086 * Initializes the Dynamic Windows engine.
2075 * Parameters: 2087 * Parameters:
2076 * newthread: True if this is the only thread. 2088 * newthread: True if this is the only thread.
2077 * False if there is already a message loop running. 2089 * False if there is already a message loop running.
2129 gtk_set_locale(); 2141 gtk_set_locale();
2130 #if !GLIB_CHECK_VERSION(2,32,0) 2142 #if !GLIB_CHECK_VERSION(2,32,0)
2131 g_thread_init(NULL); 2143 g_thread_init(NULL);
2132 #endif 2144 #endif
2133 #if GTK_MAJOR_VERSION > 1 2145 #if GTK_MAJOR_VERSION > 1
2146 g_static_rec_mutex_init(&_dw_gdk_lock);
2147
2148 gdk_threads_set_lock_functions(G_CALLBACK(_dw_gdk_lock_enter), G_CALLBACK(_dw_gdk_lock_leave));
2149
2134 gdk_threads_init(); 2150 gdk_threads_init();
2135 #endif 2151 #endif
2136 2152
2137 gtk_init(argc, argv); 2153 gtk_init(argc, argv);
2138 #ifdef USE_IMLIB 2154 #ifdef USE_IMLIB