@@ -36,8 +36,6 @@ static inline void applyGTKSettings(FFGTKResult* result, const char* themeName,
3636
3737static void detectGTKFromSettings (FFGTKResult * result )
3838{
39- static FFThreadMutex mutex = FF_THREAD_MUTEX_INITIALIZER ;
40-
4139 static const char * themeName = NULL ;
4240 static const char * iconsName = NULL ;
4341 static const char * fontName = NULL ;
@@ -47,11 +45,8 @@ static void detectGTKFromSettings(FFGTKResult* result)
4745
4846 static bool init = false;
4947
50- ffThreadMutexLock (& mutex );
51-
5248 if (init )
5349 {
54- ffThreadMutexUnlock (& mutex );
5550 applyGTKSettings (result , themeName , iconsName , fontName , cursorTheme , cursorSize , wallpaper );
5651 return ;
5752 }
@@ -103,7 +98,6 @@ static void detectGTKFromSettings(FFGTKResult* result)
10398 wallpaper = ffSettingsGet ("/org/gnome/desktop/background/picture-uri" , "org.gnome.desktop.background" , NULL , "picture-uri" , FF_VARIANT_TYPE_STRING ).strValue ;
10499 }
105100
106- ffThreadMutexUnlock (& mutex );
107101 applyGTKSettings (result , themeName , iconsName , fontName , cursorTheme , cursorSize , wallpaper );
108102}
109103
@@ -178,14 +172,10 @@ static void detectGTK(const char* version, FFGTKResult* result)
178172}
179173
180174#define FF_DETECT_GTK_IMPL (version ) \
181- static FFThreadMutex mutex = FF_THREAD_MUTEX_INITIALIZER; \
182175 static FFGTKResult result; \
183176 static bool init = false; \
184- ffThreadMutexLock(&mutex); \
185- if(init){ \
186- ffThreadMutexUnlock(&mutex);\
177+ if(init) \
187178 return &result; \
188- } \
189179 init = true; \
190180 ffStrbufInit(&result.theme); \
191181 ffStrbufInit(&result.icons); \
@@ -194,7 +184,6 @@ static void detectGTK(const char* version, FFGTKResult* result)
194184 ffStrbufInit(&result.cursorSize); \
195185 ffStrbufInit(&result.wallpaper); \
196186 detectGTK(#version, &result); \
197- ffThreadMutexUnlock(&mutex); \
198187 return &result;
199188
200189const FFGTKResult * ffDetectGTK2 (void )
0 commit comments