[Libreoffice-commits] core.git: vcl/inc vcl/unx

Michael Meeks michael.meeks at suse.com
Fri Apr 12 03:07:56 PDT 2013


 vcl/inc/unx/gtk/gtkinst.hxx |    3 +--
 vcl/unx/gtk/app/gtkinst.cxx |   24 ++++++++++--------------
 2 files changed, 11 insertions(+), 16 deletions(-)

New commits:
commit 6a0757f0e0fb4fe4b837f44b2bc9ca6455fa1c5d
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Apr 12 11:06:30 2013 +0100

    fdo#60690 - a little more cleanup of gtk+ mutex bits.
    
    Change-Id: I020d6f59751aef0bfb06667317ddcaf2965395d1

diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index b8f530c..eb65318 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -38,6 +38,7 @@ class GtkPrintWrapper;
 class GenPspGraphics;
 class GtkYieldMutex : public SalYieldMutex
 {
+    std::list<sal_uLong> aYieldStack;
 public:
                         GtkYieldMutex();
     virtual void        acquire();
@@ -47,8 +48,6 @@ public:
     virtual int         Grab()          { return 0; };
     virtual void        Ungrab(int )    {};
 
-    std::list<sal_uLong> aYieldStack;
-
     void ThreadsEnter();
     void ThreadsLeave();
 
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index af80678..1bb4bed 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -61,18 +61,6 @@ extern "C"
         GtkYieldMutex *pYieldMutex = GET_YIELD_MUTEX();
         pYieldMutex->ThreadsLeave();
     }
-    static bool hookLocks( void )
-    {
-#if !GTK_CHECK_VERSION(2,4,0)
-#error No lock hooking!
-#endif
-        gdk_threads_set_lock_functions (GdkThreadsEnter, GdkThreadsLeave);
-
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "Hooked gdk threads locks\n" );
-#endif
-        return true;
-    }
 
     VCLPLUG_GTK_PUBLIC SalInstance* create_SalInstance( oslModule )
     {
@@ -113,8 +101,16 @@ extern "C"
         if ( !g_thread_supported() )
             g_thread_init( NULL );
 
-        if ( hookLocks() )
-            pYieldMutex = new GtkYieldMutex();
+#if !GTK_CHECK_VERSION(2,4,0)
+#error "Requires gtk 2.4.0+ for lock hooking"
+#endif
+        gdk_threads_set_lock_functions (GdkThreadsEnter, GdkThreadsLeave);
+
+#if OSL_DEBUG_LEVEL > 1
+        fprintf( stderr, "Hooked gdk threads locks\n" );
+#endif
+
+        pYieldMutex = new GtkYieldMutex();
 
         gdk_threads_init();
 


More information about the Libreoffice-commits mailing list