comparison gtk/dw.c @ 1901:6923871d0048

Makefile fix from Mark Hessling...also conditionally use the old static recursive mutexes if GLib is less than 2.32 so we don't break older GTK2 versions.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 26 Mar 2014 15:10:50 +0000
parents 969f7bbc0ff5
children 3c60066cb16f
comparison
equal deleted inserted replaced
1900:969f7bbc0ff5 1901:6923871d0048
2073 # endif 2073 # endif
2074 } 2074 }
2075 } 2075 }
2076 #endif 2076 #endif
2077 2077
2078 #if GLIB_CHECK_VERSION(2,32,0)
2078 static GRecMutex _dw_gdk_lock; 2079 static GRecMutex _dw_gdk_lock;
2079 2080
2080 static void _dw_gdk_lock_enter(void) 2081 static void _dw_gdk_lock_enter(void)
2081 { 2082 {
2082 g_rec_mutex_lock(&_dw_gdk_lock); 2083 g_rec_mutex_lock(&_dw_gdk_lock);
2084 2085
2085 static void _dw_gdk_lock_leave(void) 2086 static void _dw_gdk_lock_leave(void)
2086 { 2087 {
2087 g_rec_mutex_unlock(&_dw_gdk_lock); 2088 g_rec_mutex_unlock(&_dw_gdk_lock);
2088 } 2089 }
2090 #else
2091 static GStaticRecMutex _dw_gdk_lock;
2092
2093 static void _dw_gdk_lock_enter(void)
2094 {
2095 g_static_rec_mutex_lock(&_dw_gdk_lock);
2096 }
2097
2098 static void _dw_gdk_lock_leave(void)
2099 {
2100 g_static_rec_mutex_unlock(&_dw_gdk_lock);
2101 }
2102 #endif
2089 2103
2090 /* 2104 /*
2091 * Initializes the Dynamic Windows engine. 2105 * Initializes the Dynamic Windows engine.
2092 * Parameters: 2106 * Parameters:
2093 * newthread: True if this is the only thread. 2107 * newthread: True if this is the only thread.
2146 gtk_set_locale(); 2160 gtk_set_locale();
2147 #if !GLIB_CHECK_VERSION(2,32,0) 2161 #if !GLIB_CHECK_VERSION(2,32,0)
2148 g_thread_init(NULL); 2162 g_thread_init(NULL);
2149 #endif 2163 #endif
2150 #if GTK_MAJOR_VERSION > 1 2164 #if GTK_MAJOR_VERSION > 1
2165 #if GLIB_CHECK_VERSION(2,32,0)
2151 g_rec_mutex_init(&_dw_gdk_lock); 2166 g_rec_mutex_init(&_dw_gdk_lock);
2167 #else
2168 g_static_rec_mutex_init(&_dw_gdk_lock);
2169 #endif
2152 2170
2153 gdk_threads_set_lock_functions(G_CALLBACK(_dw_gdk_lock_enter), G_CALLBACK(_dw_gdk_lock_leave)); 2171 gdk_threads_set_lock_functions(G_CALLBACK(_dw_gdk_lock_enter), G_CALLBACK(_dw_gdk_lock_leave));
2154 2172
2155 gdk_threads_init(); 2173 gdk_threads_init();
2156 #endif 2174 #endif