fdo#60690 - a little more cleanup of gtk+ mutex bits.
Change-Id: I020d6f59751aef0bfb06667317ddcaf2965395d1
This commit is contained in:
@@ -38,6 +38,7 @@ class GtkPrintWrapper;
|
|||||||
class GenPspGraphics;
|
class GenPspGraphics;
|
||||||
class GtkYieldMutex : public SalYieldMutex
|
class GtkYieldMutex : public SalYieldMutex
|
||||||
{
|
{
|
||||||
|
std::list<sal_uLong> aYieldStack;
|
||||||
public:
|
public:
|
||||||
GtkYieldMutex();
|
GtkYieldMutex();
|
||||||
virtual void acquire();
|
virtual void acquire();
|
||||||
@@ -47,8 +48,6 @@ public:
|
|||||||
virtual int Grab() { return 0; };
|
virtual int Grab() { return 0; };
|
||||||
virtual void Ungrab(int ) {};
|
virtual void Ungrab(int ) {};
|
||||||
|
|
||||||
std::list<sal_uLong> aYieldStack;
|
|
||||||
|
|
||||||
void ThreadsEnter();
|
void ThreadsEnter();
|
||||||
void ThreadsLeave();
|
void ThreadsLeave();
|
||||||
|
|
||||||
|
@@ -61,18 +61,6 @@ extern "C"
|
|||||||
GtkYieldMutex *pYieldMutex = GET_YIELD_MUTEX();
|
GtkYieldMutex *pYieldMutex = GET_YIELD_MUTEX();
|
||||||
pYieldMutex->ThreadsLeave();
|
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 )
|
VCLPLUG_GTK_PUBLIC SalInstance* create_SalInstance( oslModule )
|
||||||
{
|
{
|
||||||
@@ -113,8 +101,16 @@ extern "C"
|
|||||||
if ( !g_thread_supported() )
|
if ( !g_thread_supported() )
|
||||||
g_thread_init( NULL );
|
g_thread_init( NULL );
|
||||||
|
|
||||||
if ( hookLocks() )
|
#if !GTK_CHECK_VERSION(2,4,0)
|
||||||
pYieldMutex = new GtkYieldMutex();
|
#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();
|
gdk_threads_init();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user