[Libreoffice-commits] core.git: 4 commits - comphelper/Library_comphelper.mk comphelper/source dbaccess/source fpicker/source framework/inc framework/source include/comphelper include/osl include/sfx2 include/tools include/vcl sc/source sfx2/source svx/source sw/source tools/source vcl/aqua vcl/generic vcl/headless vcl/inc vcl/source vcl/unx vcl/win
Stephan Bergmann
sbergman at redhat.com
Tue May 14 05:42:19 PDT 2013
comphelper/Library_comphelper.mk | 1
comphelper/source/misc/solarmutex.cxx | 28 +
comphelper/source/property/ChainablePropertySet.cxx | 20 -
comphelper/source/property/MasterPropertySet.cxx | 42 +-
dbaccess/source/core/dataaccess/ModelImpl.cxx | 12
dbaccess/source/core/dataaccess/ModelImpl.hxx | 11
fpicker/source/win32/filepicker/SolarMutex.cxx | 4
framework/inc/macros/debug.hxx | 6
framework/inc/macros/debug/mutex.hxx | 101 ------
framework/inc/threadhelp/fairrwlock.hxx | 15 -
framework/inc/threadhelp/lockhelper.hxx | 53 ---
framework/inc/threadhelp/threadhelpbase.hxx | 2
framework/source/fwi/threadhelp/lockhelper.cxx | 250 +----------------
framework/source/fwi/threadhelp/transactionmanager.cxx | 8
include/comphelper/ChainablePropertySet.hxx | 5
include/comphelper/MasterPropertySet.hxx | 5
include/comphelper/SettingsHelper.hxx | 2
include/comphelper/solarmutex.hxx | 50 +++
include/osl/mutex.hxx | 26 -
include/sfx2/docstoragemodifylistener.hxx | 5
include/tools/solarmutex.hxx | 4
include/vcl/solarmutex.hxx | 18 -
include/vcl/svapp.hxx | 10
sc/source/core/data/documen3.cxx | 2
sfx2/source/doc/docstoragemodifylistener.cxx | 8
svx/source/form/fmshimp.cxx | 4
sw/source/ui/inc/unodispatch.hxx | 3
tools/source/misc/solarmutex.cxx | 4
vcl/aqua/source/app/salinst.cxx | 4
vcl/aqua/source/window/salframeview.mm | 8
vcl/generic/app/geninst.cxx | 8
vcl/headless/svpinst.cxx | 2
vcl/inc/aqua/salinst.h | 8
vcl/inc/generic/geninst.h | 4
vcl/inc/salinst.hxx | 4
vcl/inc/unx/gtk/gtkinst.hxx | 2
vcl/inc/win/salinst.h | 2
vcl/source/app/solarmutex.cxx | 2
vcl/source/app/svapp.cxx | 4
vcl/unx/generic/dtrans/X11_selection.cxx | 8
vcl/unx/gtk/app/gtkdata.cxx | 4
vcl/win/source/app/salinst.cxx | 20 -
42 files changed, 228 insertions(+), 551 deletions(-)
New commits:
commit ee47dfa4747474bceb266df5ea1638a2e3161c1c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue May 14 14:24:35 2013 +0200
LockHelper::getGlobalLock is never called with an argument
Change-Id: I90b431345d791c887f9047258a6f439bcf222784
diff --git a/framework/inc/threadhelp/lockhelper.hxx b/framework/inc/threadhelp/lockhelper.hxx
index 277609a..72f2d22 100644
--- a/framework/inc/threadhelp/lockhelper.hxx
+++ b/framework/inc/threadhelp/lockhelper.hxx
@@ -89,7 +89,10 @@ class FWI_DLLPUBLIC LockHelper : public IMutex
//-------------------------------------------------------------------------------------------------------------
// something else
//-------------------------------------------------------------------------------------------------------------
- static LockHelper& getGlobalLock ( comphelper::SolarMutex* pSolarMutex = NULL );
+ static LockHelper& getGlobalLock();
+ //TODO: this presumable should return the SolarMutex, though it
+ // actually returns some independent mutex
+
::osl::Mutex& getShareableOslMutex( );
//-------------------------------------------------------------------------------------------------------------
diff --git a/framework/source/fwi/threadhelp/lockhelper.cxx b/framework/source/fwi/threadhelp/lockhelper.cxx
index 8e2c7dd..14f3bfe 100644
--- a/framework/source/fwi/threadhelp/lockhelper.cxx
+++ b/framework/source/fwi/threadhelp/lockhelper.cxx
@@ -257,7 +257,7 @@ void LockHelper::downgradeWriteAccess()
@onerror No error should occure.
*//*-*************************************************************************************************************/
-LockHelper& LockHelper::getGlobalLock( comphelper::SolarMutex* pSolarMutex )
+LockHelper& LockHelper::getGlobalLock()
{
// Initialize static "member" only for one time!
// Algorithm:
@@ -274,7 +274,7 @@ LockHelper& LockHelper::getGlobalLock( comphelper::SolarMutex* pSolarMutex )
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( pLock == NULL )
{
- static LockHelper aLock( pSolarMutex );
+ static LockHelper aLock;
pLock = &aLock;
}
}
commit 4af8a94a96594a91cb54bd5b11d9a2f33eca5e65
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue May 14 14:01:01 2013 +0200
Remove unused LOCKTYPE_FRAMEWORK env var override
...which means that only the E_SOLARMUTEX part of LockHelper is ever used.
Change-Id: Ibff0bda324af67c85cbd2975d308c612c66e5052
diff --git a/framework/inc/threadhelp/lockhelper.hxx b/framework/inc/threadhelp/lockhelper.hxx
index 6d7bb24..277609a 100644
--- a/framework/inc/threadhelp/lockhelper.hxx
+++ b/framework/inc/threadhelp/lockhelper.hxx
@@ -31,23 +31,6 @@
namespace framework{
/*-************************************************************************************************************//**
- @descr If you use a lock or mutex as a member of your class and whish to use it earlier then other ones
- you should have a look on this implementation. You must use it as the first base class
- of your implementation - because base classes are initialized by his order and before your
- member! Thats why ist a good place to declare your thread help member so.
-*//*-*************************************************************************************************************/
-enum ELockType
-{
- E_NOTHING = 0 ,
- E_OWNMUTEX = 1 ,
- E_SOLARMUTEX = 2 ,
- E_FAIRRWLOCK = 3
-};
-
-#define ENVVAR_LOCKTYPE DECLARE_ASCII("LOCKTYPE_FRAMEWORK")
-#define FALLBACK_LOCKTYPE E_SOLARMUTEX
-
-/*-************************************************************************************************************//**
@short helper to set right lock in right situation
@descr This helper support different types of locking:
a) no locks - transparent for user!
@@ -110,34 +93,11 @@ class FWI_DLLPUBLIC LockHelper : public IMutex
::osl::Mutex& getShareableOslMutex( );
//-------------------------------------------------------------------------------------------------------------
- // private methods
- //-------------------------------------------------------------------------------------------------------------
- private:
-
- static ELockType& implts_getLockType();
-
- //-------------------------------------------------------------------------------------------------------------
// private member
- // a) Make some member mutable for using in const functions!
- // b) "m_eLockType" define, which of follow members is used!
- // You can use "m_pFairRWLock" as a fair rw-lock (multiple reader / one writer / looks for incoming order of threads too) ...
- // or you can use a normal osl mutex ("m_pOwnMutex") ...
- // ... or the solarmuex as "m_pSolarMutex" (must be set from outside! because some components must be vcl-free!)
- // ... but sometimes you need a shareable osl mutex!
- // In this case you has some problems: i ) If your lock type is set to E_OWNMUTEX => it's easy; you can use your member "m_pOwnMutex" - it's a osl mutex.
- // Creation and using of "m_pShareableOslMutex" isn't necessary!
- // ii ) Otherwise you have no osl mutex ... so you must create "m_pShareableOslMutex" and use it twice!
- // In this case you must lock two member everytime - "m_pShareableMutex" AND "m_pFairRWLock" or "m_pSolarMutex" or ...
- // It isn't realy fine - but the only possible way.
- // iii) There exist another special case - E_NOTHING is set! Then we should create this shareable mutex ...
- // nad you can use it ... but this implmentation ignore it.
+ // Make some member mutable for using in const functions!
//-------------------------------------------------------------------------------------------------------------
private:
- ELockType m_eLockType ;
-
- mutable FairRWLock* m_pFairRWLock ;
- mutable ::osl::Mutex* m_pOwnMutex ;
mutable comphelper::SolarMutex* m_pSolarMutex ;
mutable ::osl::Mutex* m_pShareableOslMutex ;
mutable sal_Bool m_bDummySolarMutex ;
diff --git a/framework/source/fwi/threadhelp/lockhelper.cxx b/framework/source/fwi/threadhelp/lockhelper.cxx
index 900fef4..8e2c7dd 100644
--- a/framework/source/fwi/threadhelp/lockhelper.cxx
+++ b/framework/source/fwi/threadhelp/lockhelper.cxx
@@ -30,11 +30,7 @@ namespace framework{
/*-************************************************************************************************************//**
@short use ctor to initialize instance
- @descr We must initialize our member "m_eLockType". This value specify handling of locking.
- User use this helper as parameter for a guard creation.
- These guard use "m_eLockType" to set lock in the right way by using right mutex or rw-lock.
- @seealso enum ELockType
@seealso class ReadGuard
@seealso class WriteGuard
@@ -45,39 +41,18 @@ namespace framework{
@onerror -
*//*-*************************************************************************************************************/
LockHelper::LockHelper( comphelper::SolarMutex* pSolarMutex )
- : m_pFairRWLock ( NULL )
- , m_pOwnMutex ( NULL )
- , m_pSolarMutex ( NULL )
+ : m_pSolarMutex ( NULL )
, m_pShareableOslMutex( NULL )
, m_bDummySolarMutex ( sal_False )
{
- m_eLockType = implts_getLockType();
- switch( m_eLockType )
+ if( pSolarMutex == NULL )
{
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex = new ::osl::Mutex;
- }
- break;
- case E_SOLARMUTEX : {
- if( pSolarMutex == NULL )
- {
- m_pSolarMutex = new ::vcl::SolarMutexObject;
- m_bDummySolarMutex = sal_True;
- }
- else
- {
- m_pSolarMutex = pSolarMutex;
- }
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock = new FairRWLock;
- }
- break;
- #ifdef ENABLE_ASSERTIONS
- default : LOG_ASSERT2( m_eLockType!=E_NOTHING, "LockHelper::ctor()", "Invalid lock type found .. so code will not be threadsafe!" )
- #endif
+ m_pSolarMutex = new ::vcl::SolarMutexObject;
+ m_bDummySolarMutex = sal_True;
+ }
+ else
+ {
+ m_pSolarMutex = pSolarMutex;
}
}
@@ -97,20 +72,9 @@ LockHelper::~LockHelper()
{
if( m_pShareableOslMutex != NULL )
{
- // Sometimes we hold two pointer to same object!
- // (e.g. if m_eLockType==E_OWNMUTEX!)
- // So we should forget it ... but don't delete it twice!
- if( m_pShareableOslMutex != m_pOwnMutex )
- {
- delete m_pShareableOslMutex;
- }
+ delete m_pShareableOslMutex;
m_pShareableOslMutex = NULL;
}
- if( m_pOwnMutex != NULL )
- {
- delete m_pOwnMutex;
- m_pOwnMutex = NULL;
- }
if( m_pSolarMutex != NULL )
{
if (m_bDummySolarMutex)
@@ -120,11 +84,6 @@ LockHelper::~LockHelper()
}
m_pSolarMutex = NULL;
}
- if( m_pFairRWLock != NULL )
- {
- delete m_pFairRWLock;
- m_pFairRWLock = NULL;
- }
}
/*-************************************************************************************************************//**
@@ -146,22 +105,7 @@ LockHelper::~LockHelper()
*//*-*************************************************************************************************************/
void LockHelper::acquire()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex->acquire();
- }
- break;
- case E_SOLARMUTEX : {
- m_pSolarMutex->acquire();
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock->acquireWriteAccess();
- }
- break;
- }
+ m_pSolarMutex->acquire();
}
/*-************************************************************************************************************//**
@@ -183,22 +127,7 @@ void LockHelper::acquire()
*//*-*************************************************************************************************************/
void LockHelper::release()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex->release();
- }
- break;
- case E_SOLARMUTEX : {
- m_pSolarMutex->release();
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock->releaseWriteAccess();
- }
- break;
- }
+ m_pSolarMutex->release();
}
/*-************************************************************************************************************//**
@@ -206,7 +135,6 @@ void LockHelper::release()
@short set lock for reading
@descr A guard should call this method to acquire read access on your member.
Writing isn't allowed then - but nobody could check it for you!
- We use m_eLockType to differ between all possible "lock-member"!!!
@attention If a shareable osl mutex exist, he must be used as twice!
It's neccessary for some cppu-helper classes ...
@@ -220,29 +148,13 @@ void LockHelper::release()
*//*-*************************************************************************************************************/
void LockHelper::acquireReadAccess()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex->acquire();
- }
- break;
- case E_SOLARMUTEX : {
- m_pSolarMutex->acquire();
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock->acquireReadAccess();
- }
- break;
- }
+ m_pSolarMutex->acquire();
}
/*-************************************************************************************************************//**
@interface IRWLock
@short reset lock for reading
@descr A guard should call this method to release read access on your member.
- We use m_eLockType to differ between all possible "lock-member"!!!
@attention If a shareable osl mutex exist, he must be used as twice!
It's neccessary for some cppu-helper classes ...
@@ -256,22 +168,7 @@ void LockHelper::acquireReadAccess()
*//*-*************************************************************************************************************/
void LockHelper::releaseReadAccess()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex->release();
- }
- break;
- case E_SOLARMUTEX : {
- m_pSolarMutex->release();
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock->releaseReadAccess();
- }
- break;
- }
+ m_pSolarMutex->release();
}
/*-************************************************************************************************************//**
@@ -280,7 +177,6 @@ void LockHelper::releaseReadAccess()
@descr A guard should call this method to acquire write access on your member.
Reading is allowed too - of course.
After successfully calling of this method you are the only writer.
- We use m_eLockType to differ between all possible "lock-member"!!!
@attention If a shareable osl mutex exist, he must be used as twice!
It's neccessary for some cppu-helper classes ...
@@ -294,29 +190,13 @@ void LockHelper::releaseReadAccess()
*//*-*************************************************************************************************************/
void LockHelper::acquireWriteAccess()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex->acquire();
- }
- break;
- case E_SOLARMUTEX : {
- m_pSolarMutex->acquire();
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock->acquireWriteAccess();
- }
- break;
- }
+ m_pSolarMutex->acquire();
}
/*-************************************************************************************************************//**
@interface IRWLock
@short reset lock for writing
@descr A guard should call this method to release write access on your member.
- We use m_eLockType to differ between all possible "lock-member"!!!
@attention If a shareable osl mutex exist, he must be used as twice!
It's neccessary for some cppu-helper classes ...
@@ -330,22 +210,7 @@ void LockHelper::acquireWriteAccess()
*//*-*************************************************************************************************************/
void LockHelper::releaseWriteAccess()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : {
- m_pOwnMutex->release();
- }
- break;
- case E_SOLARMUTEX : {
- m_pSolarMutex->release();
- }
- break;
- case E_FAIRRWLOCK : {
- m_pFairRWLock->releaseWriteAccess();
- }
- break;
- }
+ m_pSolarMutex->release();
}
/*-************************************************************************************************************//**
@@ -353,7 +218,6 @@ void LockHelper::releaseWriteAccess()
@short downgrade a write access to a read access
@descr A guard should call this method to change a write to a read access.
New readers can work too - new writer are blocked!
- We use m_eLockType to differ between all possible "lock-member"!!!
@attention Ignore shareable mutex(!) - because this call never should release a lock completely!
We change a write access to a read access only.
@@ -362,7 +226,7 @@ void LockHelper::releaseWriteAccess()
Results are not defined then ...
An upgrade can't be implemented realy ... because acquiring new access
will be the same - there no differences!
- b) Without function if m_eLockTyp is different from E_FAIRRWLOCK(!) ...
+ b) Without function ...
because, a mutex don't support it realy.
@seealso -
@@ -374,14 +238,7 @@ void LockHelper::releaseWriteAccess()
*//*-*************************************************************************************************************/
void LockHelper::downgradeWriteAccess()
{
- switch( m_eLockType )
- {
- case E_NOTHING : break; // There is nothing to do ...
- case E_OWNMUTEX : break; // Not supported for mutex!
- case E_SOLARMUTEX : break; // Not supported for mutex!
- case E_FAIRRWLOCK : m_pFairRWLock->downgradeWriteAccess();
- break;
- }
+ // Not supported for mutex!
}
/*-************************************************************************************************************//**
@@ -428,8 +285,7 @@ LockHelper& LockHelper::getGlobalLock( comphelper::SolarMutex* pSolarMutex )
@short return a reference to shared mutex member
@descr Sometimes we need a osl-mutex for sharing with our uno helper ...
What can we do?
- a) If we have an initialized "own mutex" ... we can use it!
- b) Otherwhise we must use a different mutex member :-(
+ We must use a different mutex member :-(
I HOPE IT WORKS!
@seealso -
@@ -446,72 +302,12 @@ LockHelper& LockHelper::getGlobalLock( comphelper::SolarMutex* pSolarMutex )
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( m_pShareableOslMutex == NULL )
{
- switch( m_eLockType )
- {
- case E_OWNMUTEX : {
- m_pShareableOslMutex = m_pOwnMutex;
- }
- break;
- default : {
- m_pShareableOslMutex = new ::osl::Mutex;
- }
- break;
- }
+ m_pShareableOslMutex = new ::osl::Mutex;
}
}
return *m_pShareableOslMutex;
}
-/*-************************************************************************************************************//**
- @short search for right lock type, which should be used by an instance of this struct
- @descr We must initialize our member "m_eLockType". This value specify handling of locking.
- How we can do that? We search for an environment variable. We do it only for one time ....
- because the environment is fix. So we safe this value and use it for all further requests.
- If no variable could be found - we use a fallback!
-
- @attention We have numbered all our enum values for ELockType. So we can use it as value of searched
- environment variable too!
-
- @seealso enum ELockType
- @seealso environment LOCKTYPE
-
- @param -
- @return A reference to a created and right initialized lock type!
-
- @onerror We use a fallback!
-*//*-*************************************************************************************************************/
-ELockType& LockHelper::implts_getLockType()
-{
- // Initialize static "member" only for one time!
- // Algorithm:
- // a) Start with an invalid variable (NULL pointer)
- // b) If these method first called (value not already exist!) ...
- // c) ... we must create a new one. Protect follow code with the global mutex -
- // (It must be - we create a static variable!)
- // d) Check pointer again - because ... another instance of our class could be faster then these one!
- // e) Create the new static variable, get value from the environment and set it
- // f) Return new created or already existing static variable.
- static ELockType* pType = NULL;
- if( pType == NULL )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( pType == NULL )
- {
- static ELockType eType = FALLBACK_LOCKTYPE;
-
- OUString aEnvVar( ENVVAR_LOCKTYPE );
- OUString sValue ;
- if( osl_getEnvironment( aEnvVar.pData, &sValue.pData ) == osl_Process_E_None )
- {
- eType = (ELockType)(sValue.toInt32());
- }
-
- pType = &eType;
- }
- }
- return *pType;
-}
-
} // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 61ac80a6f6d1efef7e69d2ded98ae53fe8e5a156
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue May 14 13:26:51 2013 +0200
ENABLE_MUTEXDEBUG is never defined
Change-Id: I533cc7041177cceff14d1e44e4cd1d25d5e94c11
diff --git a/framework/inc/macros/debug.hxx b/framework/inc/macros/debug.hxx
index ca1e457..c56dcf9 100644
--- a/framework/inc/macros/debug.hxx
+++ b/framework/inc/macros/debug.hxx
@@ -70,7 +70,6 @@
#undef ENABLE_WARNINGS
#undef ENABLE_EVENTDEBUG
#undef ENABLE_REGISTRATIONDEBUG
- #undef ENABLE_MUTEXDEBUG
// #undef ENABLE_TIMEMEASURE
#undef ENABLE_MEMORYMEASURE
#undef ENABLE_FILTERDBG
@@ -99,11 +98,6 @@
#include <macros/debug/registration.hxx>
//*****************************************************************************************************************
-// special macros to debug threading mechanism
-//*****************************************************************************************************************
-#include <macros/debug/mutex.hxx>
-
-//*****************************************************************************************************************
// special macros to debug our filter cache!
//*****************************************************************************************************************
#include <macros/debug/filterdbg.hxx>
diff --git a/framework/inc/macros/debug/mutex.hxx b/framework/inc/macros/debug/mutex.hxx
deleted file mode 100644
index ddaf332..0000000
--- a/framework/inc/macros/debug/mutex.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_MUTEX_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_MUTEX_HXX_
-
-//*****************************************************************************************************************
-// special macros for mutex handling
-//*****************************************************************************************************************
-
-#ifdef ENABLE_MUTEXDEBUG
-
- #include <rtl/strbuf.hxx>
-
- /*_____________________________________________________________________________________________________________
- LOGFILE_MUTEX
-
- For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
- _____________________________________________________________________________________________________________*/
-
- #ifndef LOGFILE_MUTEX
- #define LOGFILE_MUTEX "mutex.log"
- #endif
-
- /*_____________________________________________________________________________________________________________
- LOG_LOCKTYPE( _EFALLBACK, _ECURRENT )
-
- Write information about current set lock type for whole framework project to special file.
- _____________________________________________________________________________________________________________*/
-
- #define LOG_LOCKTYPE( _EFALLBACK, _ECURRENT ) \
- /* new scope to prevent us against multiple definitions of variables ... */ \
- { \
- OStringBuffer _sBuffer( 256 ); \
- _sBuffer.append( "Set framework lock type to fallback: \"" ); \
- switch( _EFALLBACK ) \
- { \
- case E_NOTHING : _sBuffer.append( "E_NOTHING" ); \
- break; \
- case E_OWNMUTEX : _sBuffer.append( "E_OWNMUTEX" ); \
- break; \
- case E_SOLARMUTEX : _sBuffer.append( "E_SOLARMUTEX" ); \
- break; \
- case E_FAIRRWLOCK : _sBuffer.append( "E_FAIRRWLOCK" ); \
- break; \
- } \
- _sBuffer.append( "\"\n" ); \
- if( _EFALLBACK != _ECURRENT ) \
- { \
- _sBuffer.append( "... environment overwrite framework lock type with: \"" ); \
- switch( _ECURRENT ) \
- { \
- case E_NOTHING : _sBuffer.append( "E_NOTHING" ); \
- break; \
- case E_OWNMUTEX : _sBuffer.append( "E_OWNMUTEX" ); \
- break; \
- case E_SOLARMUTEX : _sBuffer.append( "E_SOLARMUTEX" ); \
- break; \
- case E_FAIRRWLOCK : _sBuffer.append( "E_FAIRRWLOCK" ); \
- break; \
- } \
- _sBuffer.append( "\"\n" ); \
- } \
- else \
- { \
- _sBuffer.append( "... use fallback, because user don't set another value!\n" ); \
- } \
- WRITE_LOGFILE( LOGFILE_MUTEX, _sBuffer.makeStringAndClear() ) \
- }
-
-#else // #ifdef ENABLE_MUTEXDEBUG
-
- /*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macro with normal functionality!
- We need the guard but not the log mechanism.
- _____________________________________________________________________________________________________________*/
-
- #undef LOGFILE_MUTEX
- #define LOG_LOCKTYPE( _EFALLBACK, _ECURRENT )
-
-#endif // #ifdef ENABLE_MUTEXDEBUG
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_MUTEX_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/inc/threadhelp/fairrwlock.hxx b/framework/inc/threadhelp/fairrwlock.hxx
index 61b3b52..4e4e5d7 100644
--- a/framework/inc/threadhelp/fairrwlock.hxx
+++ b/framework/inc/threadhelp/fairrwlock.hxx
@@ -163,11 +163,6 @@ class FairRWLock : public IRWLock
// Used condition will open by last gone reader object.
m_aSerializer.acquire();
m_aWriteCondition.wait();
-
- #ifdef ENABLE_MUTEXDEBUG
- // A writer is an exclusiv accessor!
- LOG_ASSERT2( m_nReadCount!=0, "FairRWLock::acquireWriteAccess()", "No threadsafe code detected ... : Read count != 0!" )
- #endif
}
/*-****************************************************************************************************//**
@@ -189,11 +184,6 @@ class FairRWLock : public IRWLock
// by these mutex!
// You don't need any other mutex here - you are the only one in the moment!
- #ifdef ENABLE_MUTEXDEBUG
- // A writer is an exclusiv accessor!
- LOG_ASSERT2( m_nReadCount!=0, "FairRWLock::releaseWriteAccess()", "No threadsafe code detected ... : Read count != 0!" )
- #endif
-
m_aSerializer.release();
}
@@ -221,11 +211,6 @@ class FairRWLock : public IRWLock
// We can't check it - but otherwise it's your problem ...
// Thats why you don't need any mutex here.
- #ifdef ENABLE_MUTEXDEBUG
- // A writer is an exclusiv accessor!
- LOG_ASSERT2( m_nReadCount!=0, "FairRWLock::downgradeWriteAccess()", "No threadsafe code detected ... : Read count != 0!" )
- #endif
-
// Register himself as "new" reader.
// This value must be 0 before - because we support single writer access only!
++m_nReadCount;
diff --git a/framework/source/fwi/threadhelp/lockhelper.cxx b/framework/source/fwi/threadhelp/lockhelper.cxx
index d32fafb..900fef4 100644
--- a/framework/source/fwi/threadhelp/lockhelper.cxx
+++ b/framework/source/fwi/threadhelp/lockhelper.cxx
@@ -506,8 +506,6 @@ ELockType& LockHelper::implts_getLockType()
eType = (ELockType)(sValue.toInt32());
}
- LOG_LOCKTYPE( FALLBACK_LOCKTYPE, eType )
-
pType = &eType;
}
}
diff --git a/framework/source/fwi/threadhelp/transactionmanager.cxx b/framework/source/fwi/threadhelp/transactionmanager.cxx
index 7f3ac48..5c1ccfb 100644
--- a/framework/source/fwi/threadhelp/transactionmanager.cxx
+++ b/framework/source/fwi/threadhelp/transactionmanager.cxx
@@ -200,10 +200,6 @@ void TransactionManager::registerTransaction( EExceptionMode eMode, ERejectReas
// Safe access to internal member.
::osl::MutexGuard aAccessGuard( m_aAccessLock );
- #ifdef ENABLE_MUTEXDEBUG
- LOG_ASSERT2( m_nTransactionCount<0, "TransactionManager::acquire()", "Wrong ref count detected!" )
- #endif
-
// Register this new transaction.
// If it is the first one .. close gate to disable changing of working mode.
++m_nTransactionCount;
@@ -231,10 +227,6 @@ void TransactionManager::unregisterTransaction() throw( css::uno::RuntimeExcept
// Safe access to internal member.
::osl::MutexGuard aAccessGuard( m_aAccessLock );
- #ifdef ENABLE_MUTEXDEBUG
- LOG_ASSERT2( m_nTransactionCount<=0, "TransactionManager::release()", "Wrong ref count detected!" )
- #endif
-
// Deregister this transaction.
// If it was the last one ... open gate to enable changing of working mode!
// (see setWorkingMode())
commit 11fd73acce5d8bff7025bb6ddcbaf99d9d70b545
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue May 14 13:15:38 2013 +0200
SolarMutex does not belong into the URE interface
...so move it from osl/mutex.hxx to its own comphelper/solarmutex.hxx. It looks
like a newbie mistake that 59e7685d8d812ee8773f57475cbe3aa2a0bdfc81 "Create an
abstract interface to be used to implement a SolarMutex" put it here in the
first place.
I do not consider this an incompatible change really, as no external URE client
code should have used SolarMutex anyway.
(Also included some clean up, like removing unused
{Clearable,Resettable}SolarGuard, and spelling out SolarGuard in the few places
it is used.)
Change-Id: I121ffb5b7cefbc19e88b5405e5a85ffc895be852
diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk
index 0746889..09a6889 100644
--- a/comphelper/Library_comphelper.mk
+++ b/comphelper/Library_comphelper.mk
@@ -106,6 +106,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
comphelper/source/misc/servicedecl \
comphelper/source/misc/serviceinfohelper \
comphelper/source/misc/sharedmutex \
+ comphelper/source/misc/solarmutex \
comphelper/source/misc/stillreadwriteinteraction \
comphelper/source/misc/anycompare \
comphelper/source/misc/storagehelper \
diff --git a/comphelper/source/misc/solarmutex.cxx b/comphelper/source/misc/solarmutex.cxx
new file mode 100644
index 0000000..af17a9a
--- /dev/null
+++ b/comphelper/source/misc/solarmutex.cxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "sal/config.h"
+
+#include "comphelper/solarmutex.hxx"
+
+comphelper::SolarMutex::SolarMutex() {}
+
+comphelper::SolarMutex::~SolarMutex() {}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx
index cd078a9..c4cc545 100644
--- a/comphelper/source/property/ChainablePropertySet.cxx
+++ b/comphelper/source/property/ChainablePropertySet.cxx
@@ -19,7 +19,7 @@
#include <comphelper/ChainablePropertySet.hxx>
#include <comphelper/ChainablePropertySetInfo.hxx>
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <boost/scoped_ptr.hpp>
@@ -31,7 +31,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
-ChainablePropertySet::ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, osl::SolarMutex* pMutex )
+ChainablePropertySet::ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, comphelper::SolarMutex* pMutex )
throw()
: mpInfo ( pInfo )
, mpMutex ( pMutex )
@@ -55,9 +55,9 @@ void SAL_CALL ChainablePropertySet::setPropertyValue( const OUString& rPropertyN
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName );
@@ -73,9 +73,9 @@ Any SAL_CALL ChainablePropertySet::getPropertyValue( const OUString& rPropertyNa
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName );
@@ -119,9 +119,9 @@ void SAL_CALL ChainablePropertySet::setPropertyValues( const Sequence< OUString
throw(PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength();
@@ -153,9 +153,9 @@ Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const Sequence
throw(RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength();
diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx
index f996e8b..6477e11 100644
--- a/comphelper/source/property/MasterPropertySet.cxx
+++ b/comphelper/source/property/MasterPropertySet.cxx
@@ -22,7 +22,7 @@
#include <comphelper/MasterPropertySetInfo.hxx>
#include <comphelper/ChainablePropertySet.hxx>
#include <comphelper/ChainablePropertySetInfo.hxx>
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <boost/scoped_ptr.hpp>
@@ -30,16 +30,16 @@
class AutoOGuardArray
{
- boost::scoped_ptr< osl::SolarGuard > * mpGuardArray;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > * mpGuardArray;
public:
AutoOGuardArray( sal_Int32 nNumElements );
~AutoOGuardArray();
- boost::scoped_ptr< osl::SolarGuard > & operator[] ( sal_Int32 i ) { return mpGuardArray[i]; }
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > & operator[] ( sal_Int32 i ) { return mpGuardArray[i]; }
};
-AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new boost::scoped_ptr< osl::SolarGuard >[nNumElements])
+AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > >[nNumElements])
{
}
@@ -67,7 +67,7 @@ SlaveData::SlaveData ( ChainablePropertySet *pSlave)
{
}
-MasterPropertySet::MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, osl::SolarMutex* pMutex )
+MasterPropertySet::MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, comphelper::SolarMutex* pMutex )
throw()
: mpInfo ( pInfo )
, mpMutex ( pMutex )
@@ -105,9 +105,9 @@ void SAL_CALL MasterPropertySet::setPropertyValue( const OUString& rPropertyName
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
PropertyDataHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName );
@@ -125,9 +125,9 @@ void SAL_CALL MasterPropertySet::setPropertyValue( const OUString& rPropertyName
ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave;
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard2;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard2;
if (pSlave->mpMutex)
- pMutexGuard2.reset( new osl::SolarGuard(pSlave->mpMutex) );
+ pMutexGuard2.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) );
pSlave->_preSetValues();
pSlave->_setSingleValue( *((*aIter).second->mpInfo), rValue );
@@ -139,9 +139,9 @@ Any SAL_CALL MasterPropertySet::getPropertyValue( const OUString& rPropertyName
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
PropertyDataHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName );
@@ -160,9 +160,9 @@ Any SAL_CALL MasterPropertySet::getPropertyValue( const OUString& rPropertyName
ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave;
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard2;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard2;
if (pSlave->mpMutex)
- pMutexGuard2.reset( new osl::SolarGuard(pSlave->mpMutex) );
+ pMutexGuard2.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) );
pSlave->_preGetValues();
pSlave->_getSingleValue( *((*aIter).second->mpInfo), aAny );
@@ -200,9 +200,9 @@ void SAL_CALL MasterPropertySet::setPropertyValues( const Sequence< OUString >&
throw(PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength();
@@ -239,7 +239,7 @@ void SAL_CALL MasterPropertySet::setPropertyValues( const Sequence< OUString >&
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
if (pSlave->mpSlave->mpMutex)
- aOGuardArray[i].reset( new osl::SolarGuard(pSlave->mpSlave->mpMutex) );
+ aOGuardArray[i].reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpSlave->mpMutex) );
pSlave->mpSlave->_preSetValues();
pSlave->SetInit ( sal_True );
@@ -266,9 +266,9 @@ Sequence< Any > SAL_CALL MasterPropertySet::getPropertyValues( const Sequence< O
throw(RuntimeException)
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength();
@@ -304,7 +304,7 @@ Sequence< Any > SAL_CALL MasterPropertySet::getPropertyValues( const Sequence< O
{
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
if (pSlave->mpSlave->mpMutex)
- aOGuardArray[i].reset( new osl::SolarGuard(pSlave->mpSlave->mpMutex) );
+ aOGuardArray[i].reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpSlave->mpMutex) );
pSlave->mpSlave->_preGetValues();
pSlave->SetInit ( sal_True );
@@ -367,9 +367,9 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const OUString& Prop
ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave;
// acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- boost::scoped_ptr< osl::SolarGuard > pMutexGuard;
+ boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard;
if (pSlave->mpMutex)
- pMutexGuard.reset( new osl::SolarGuard(pSlave->mpMutex) );
+ pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) );
pSlave->_preGetPropertyState();
pSlave->_getPropertyState( *((*aIter).second->mpInfo), aState );
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 95af6b7..e015e7c 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -95,19 +95,19 @@ VosMutexFacade::VosMutexFacade( ::osl::Mutex& _rMutex )
{
}
-void SAL_CALL VosMutexFacade::acquire()
+void VosMutexFacade::acquire()
{
m_rMutex.acquire();
}
-sal_Bool SAL_CALL VosMutexFacade::tryToAcquire()
+void VosMutexFacade::release()
{
- return m_rMutex.tryToAcquire();
+ m_rMutex.release();
}
-void SAL_CALL VosMutexFacade::release()
+bool VosMutexFacade::tryToAcquire()
{
- m_rMutex.release();
+ return m_rMutex.tryToAcquire();
}
//============================================================
@@ -1194,7 +1194,7 @@ namespace
{
void lcl_modifyListening( ::sfx2::IModifiableDocument& _rDocument,
const Reference< XStorage >& _rxStorage, ::rtl::Reference< ::sfx2::DocumentStorageModifyListener >& _inout_rListener,
- ::osl::SolarMutex& _rMutex, bool _bListen )
+ comphelper::SolarMutex& _rMutex, bool _bListen )
{
Reference< XModifiable > xModify( _rxStorage, UNO_QUERY );
OSL_ENSURE( xModify.is() || !_rxStorage.is(), "lcl_modifyListening: storage can't notify us!" );
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx
index fa59564..eff4138 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.hxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx
@@ -62,13 +62,13 @@
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/proparrhlp.hxx>
#include <comphelper/sharedmutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <connectivity/CommonTools.hxx>
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/weakref.hxx>
#include <sfx2/docmacromode.hxx>
#include <sfx2/docstoragemodifylistener.hxx>
#include <unotools/sharedunocomponent.hxx>
-#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include <memory>
@@ -128,7 +128,7 @@ class OSharedConnectionManager;
//============================================================
/** a class which provides an IMutex interface to an OSL-based mutex
*/
-class VosMutexFacade : public ::osl::SolarMutex
+class VosMutexFacade : public comphelper::SolarMutex
{
public:
/** beware of life time: the mutex you pass here must live as least as long
@@ -136,10 +136,9 @@ public:
*/
VosMutexFacade( ::osl::Mutex& _rMutex );
- // IMutex
- virtual void SAL_CALL acquire();
- virtual sal_Bool SAL_CALL tryToAcquire();
- virtual void SAL_CALL release();
+ virtual void acquire();
+ virtual void release();
+ virtual bool tryToAcquire();
private:
::osl::Mutex& m_rMutex;
diff --git a/fpicker/source/win32/filepicker/SolarMutex.cxx b/fpicker/source/win32/filepicker/SolarMutex.cxx
index ed4c289..c21f994 100644
--- a/fpicker/source/win32/filepicker/SolarMutex.cxx
+++ b/fpicker/source/win32/filepicker/SolarMutex.cxx
@@ -19,7 +19,7 @@
#include <vcl/svapp.hxx>
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <osl/thread.hxx>
int ReleaseSolarMutexOnMainThreadContext(unsigned nThreadId)
@@ -29,7 +29,7 @@ int ReleaseSolarMutexOnMainThreadContext(unsigned nThreadId)
if ( nMainThreadId == nThreadId )
{
- ::osl::SolarMutex& rMutex = Application::GetSolarMutex();
+ comphelper::SolarMutex& rMutex = Application::GetSolarMutex();
if ( rMutex.tryToAcquire() )
nAcquireCount = Application::ReleaseSolarMutex() - 1;
}
diff --git a/framework/inc/threadhelp/lockhelper.hxx b/framework/inc/threadhelp/lockhelper.hxx
index 93641b5..6d7bb24 100644
--- a/framework/inc/threadhelp/lockhelper.hxx
+++ b/framework/inc/threadhelp/lockhelper.hxx
@@ -25,7 +25,7 @@
#include <threadhelp/irwlock.h>
#include <threadhelp/fairrwlock.hxx>
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <fwidllapi.h>
namespace framework{
@@ -85,7 +85,7 @@ class FWI_DLLPUBLIC LockHelper : public IMutex
//-------------------------------------------------------------------------------------------------------------
// ctor/dtor
//-------------------------------------------------------------------------------------------------------------
- LockHelper( ::osl::SolarMutex* pSolarMutex = NULL );
+ LockHelper( comphelper::SolarMutex* pSolarMutex = NULL );
virtual ~LockHelper( );
//-------------------------------------------------------------------------------------------------------------
@@ -106,7 +106,7 @@ class FWI_DLLPUBLIC LockHelper : public IMutex
//-------------------------------------------------------------------------------------------------------------
// something else
//-------------------------------------------------------------------------------------------------------------
- static LockHelper& getGlobalLock ( ::osl::SolarMutex* pSolarMutex = NULL );
+ static LockHelper& getGlobalLock ( comphelper::SolarMutex* pSolarMutex = NULL );
::osl::Mutex& getShareableOslMutex( );
//-------------------------------------------------------------------------------------------------------------
@@ -138,7 +138,7 @@ class FWI_DLLPUBLIC LockHelper : public IMutex
mutable FairRWLock* m_pFairRWLock ;
mutable ::osl::Mutex* m_pOwnMutex ;
- mutable ::osl::SolarMutex* m_pSolarMutex ;
+ mutable comphelper::SolarMutex* m_pSolarMutex ;
mutable ::osl::Mutex* m_pShareableOslMutex ;
mutable sal_Bool m_bDummySolarMutex ;
};
diff --git a/framework/inc/threadhelp/threadhelpbase.hxx b/framework/inc/threadhelp/threadhelpbase.hxx
index 042d4f6..b139598 100644
--- a/framework/inc/threadhelp/threadhelpbase.hxx
+++ b/framework/inc/threadhelp/threadhelpbase.hxx
@@ -45,7 +45,7 @@ struct ThreadHelpBase
// public methods
//-------------------------------------------------------------------------------------------------------------
public:
- ThreadHelpBase( ::osl::SolarMutex* pSolarMutex = NULL )
+ ThreadHelpBase( comphelper::SolarMutex* pSolarMutex = NULL )
: m_aLock( pSolarMutex )
{
}
diff --git a/framework/source/fwi/threadhelp/lockhelper.cxx b/framework/source/fwi/threadhelp/lockhelper.cxx
index 3b4d728..d32fafb 100644
--- a/framework/source/fwi/threadhelp/lockhelper.cxx
+++ b/framework/source/fwi/threadhelp/lockhelper.cxx
@@ -44,7 +44,7 @@ namespace framework{
@onerror -
*//*-*************************************************************************************************************/
-LockHelper::LockHelper( ::osl::SolarMutex* pSolarMutex )
+LockHelper::LockHelper( comphelper::SolarMutex* pSolarMutex )
: m_pFairRWLock ( NULL )
, m_pOwnMutex ( NULL )
, m_pSolarMutex ( NULL )
@@ -400,7 +400,7 @@ void LockHelper::downgradeWriteAccess()
@onerror No error should occure.
*//*-*************************************************************************************************************/
-LockHelper& LockHelper::getGlobalLock( ::osl::SolarMutex* pSolarMutex )
+LockHelper& LockHelper::getGlobalLock( comphelper::SolarMutex* pSolarMutex )
{
// Initialize static "member" only for one time!
// Algorithm:
diff --git a/include/comphelper/ChainablePropertySet.hxx b/include/comphelper/ChainablePropertySet.hxx
index 2dfe5f3..62546c0 100644
--- a/include/comphelper/ChainablePropertySet.hxx
+++ b/include/comphelper/ChainablePropertySet.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <comphelper/PropertyInfoHash.hxx>
#include "comphelper/comphelperdllapi.h"
+#include "comphelper/solarmutex.hxx"
namespace comphelper
{
@@ -59,7 +60,7 @@ namespace comphelper
friend class MasterPropertySet;
protected:
ChainablePropertySetInfo *mpInfo;
- osl::SolarMutex* mpMutex;
+ SolarMutex* mpMutex;
::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySetInfo > mxInfo;
virtual void _preSetValues ()
@@ -89,7 +90,7 @@ namespace comphelper
throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
public:
- ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, osl::SolarMutex* pMutex = NULL )
+ ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, SolarMutex* pMutex = NULL )
throw();
virtual ~ChainablePropertySet()
throw();
diff --git a/include/comphelper/MasterPropertySet.hxx b/include/comphelper/MasterPropertySet.hxx
index 266137f..00784c4 100644
--- a/include/comphelper/MasterPropertySet.hxx
+++ b/include/comphelper/MasterPropertySet.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <comphelper/PropertyInfoHash.hxx>
#include "comphelper/comphelperdllapi.h"
+#include "comphelper/solarmutex.hxx"
#include <map>
namespace comphelper
@@ -60,7 +61,7 @@ namespace comphelper
{
protected:
MasterPropertySetInfo *mpInfo;
- osl::SolarMutex* mpMutex;
+ SolarMutex* mpMutex;
sal_uInt8 mnLastId;
SlaveMap maSlaveMap;
::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySetInfo > mxInfo;
@@ -92,7 +93,7 @@ namespace comphelper
throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
public:
- MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, ::osl::SolarMutex* pMutex = NULL )
+ MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, SolarMutex* pMutex = NULL )
throw();
virtual ~MasterPropertySet()
throw();
diff --git a/include/comphelper/SettingsHelper.hxx b/include/comphelper/SettingsHelper.hxx
index d623fa3..341b743 100644
--- a/include/comphelper/SettingsHelper.hxx
+++ b/include/comphelper/SettingsHelper.hxx
@@ -43,7 +43,7 @@ namespace comphelper
public ComphelperBase
{
public:
- SettingsHelperNoState ( ComphelperBaseInfo *pInfo, ::osl::SolarMutex* pMutex = NULL)
+ SettingsHelperNoState ( ComphelperBaseInfo *pInfo, SolarMutex* pMutex = NULL)
: ComphelperBase ( pInfo, pMutex )
{}
virtual ~SettingsHelperNoState () throw( ) {}
diff --git a/include/comphelper/solarmutex.hxx b/include/comphelper/solarmutex.hxx
new file mode 100644
index 0000000..f8fce1e
--- /dev/null
+++ b/include/comphelper/solarmutex.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_SOLARMUTEX_HXX
+#define INCLUDED_COMPHELPER_SOLARMUTEX_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "comphelper/comphelperdllapi.h"
+
+namespace comphelper {
+
+/** SolarMutex interface, needed for Application::GetSolarMutex().
+*/
+class COMPHELPER_DLLPUBLIC SolarMutex: private boost::noncopyable {
+public:
+ virtual void acquire() = 0;
+
+ virtual void release() = 0;
+
+ virtual bool tryToAcquire() = 0;
+
+protected:
+ SolarMutex();
+
+ virtual ~SolarMutex();
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/osl/mutex.hxx b/include/osl/mutex.hxx
index 18ff444..9fab63f 100644
--- a/include/osl/mutex.hxx
+++ b/include/osl/mutex.hxx
@@ -238,32 +238,6 @@ namespace osl
typedef Guard<Mutex> MutexGuard;
typedef ClearableGuard<Mutex> ClearableMutexGuard;
typedef ResettableGuard< Mutex > ResettableMutexGuard;
-
- /** SolarMutex interface, needed for SolarMutex.
- Deprecated, used just for Application::GetSolarMutex().
- */
- class SolarMutex
- {
- public:
- /** Blocks if mutex is already in use
- */
- virtual void SAL_CALL acquire() = 0;
-
- /** Tries to get the mutex without blocking.
- */
- virtual sal_Bool SAL_CALL tryToAcquire() = 0;
-
- /** Releases the mutex.
- */
- virtual void SAL_CALL release() = 0;
-
- protected:
- SolarMutex() {}
- virtual ~SolarMutex() {}
- };
- typedef osl::Guard< SolarMutex > SolarGuard;
- typedef osl::ClearableGuard< SolarMutex > ClearableSolarGuard;
- typedef osl::ResettableGuard< SolarMutex > ResettableSolarGuard;
}
#endif /* __cplusplus */
diff --git a/include/sfx2/docstoragemodifylistener.hxx b/include/sfx2/docstoragemodifylistener.hxx
index c361b87..792a8da 100644
--- a/include/sfx2/docstoragemodifylistener.hxx
+++ b/include/sfx2/docstoragemodifylistener.hxx
@@ -26,6 +26,7 @@
#include <cppuhelper/implbase1.hxx>
+namespace comphelper { class SolarMutex; }
//........................................................................
namespace sfx2
@@ -55,10 +56,10 @@ namespace sfx2
class SFX2_DLLPUBLIC DocumentStorageModifyListener : public DocumentStorageModifyListener_Base
{
IModifiableDocument* m_pDocument;
- ::osl::SolarMutex& m_rMutex;
+ comphelper::SolarMutex& m_rMutex;
public:
- DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::osl::SolarMutex& _rMutex );
+ DocumentStorageModifyListener( IModifiableDocument& _rDocument, comphelper::SolarMutex& _rMutex );
void dispose();
diff --git a/include/tools/solarmutex.hxx b/include/tools/solarmutex.hxx
index 1d6b13c..cf4b156 100644
--- a/include/tools/solarmutex.hxx
+++ b/include/tools/solarmutex.hxx
@@ -20,14 +20,14 @@
#define _TOOLS_SOLARMUTEX_HXX
#include "tools/toolsdllapi.h"
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
namespace tools
{
class TOOLS_DLLPUBLIC SolarMutex
{
public:
- static void SetSolarMutex( ::osl::SolarMutex* pMutex );
+ static void SetSolarMutex( comphelper::SolarMutex* pMutex );
static bool Acquire();
static void Release();
};
diff --git a/include/vcl/solarmutex.hxx b/include/vcl/solarmutex.hxx
index a6880a6..48b4f0c 100644
--- a/include/vcl/solarmutex.hxx
+++ b/include/vcl/solarmutex.hxx
@@ -20,7 +20,8 @@
#ifndef _VCL_SOLARMUTEX_HXX_
#define _VCL_SOLARMUTEX_HXX_
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
+#include <osl/mutex.h>
#include <vcl/dllapi.h>
namespace vcl
@@ -28,7 +29,7 @@ namespace vcl
/** Implementation of the SolarMutex interface.
*/
-class VCL_DLLPUBLIC SolarMutexObject : public osl::SolarMutex
+class VCL_DLLPUBLIC SolarMutexObject : public comphelper::SolarMutex
{
public:
//static SolarMutex& SAL_CALL getGlobalMutex();
@@ -41,18 +42,11 @@ public:
*/
virtual ~SolarMutexObject();
- /** Blocks if Mutex is already in use
- */
- virtual void SAL_CALL acquire();
+ virtual void acquire();
- /** Tries to get the mutex without blocking.
- @return True if mutex could be obtained, otherwise False
- */
- virtual sal_Bool SAL_CALL tryToAcquire();
+ virtual void release();
- /** Releases the mutex.
- */
- virtual void SAL_CALL release();
+ virtual bool tryToAcquire();
protected:
oslMutex m_solarMutex;
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index f2f59c2..ffe228e 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -26,8 +26,8 @@
#include <stdexcept>
+#include <comphelper/solarmutex.hxx>
#include <osl/thread.hxx>
-#include <osl/mutex.hxx>
#include <tools/string.hxx>
#include <tools/link.hxx>
#include <tools/solar.h>
@@ -165,7 +165,7 @@ public:
static void Reschedule( bool bAllEvents = false );
static void Yield( bool bAllEvents = false );
static void EndYield();
- static osl::SolarMutex& GetSolarMutex();
+ static comphelper::SolarMutex& GetSolarMutex();
static oslThreadIdentifier GetMainThreadIdentifier();
static sal_uLong ReleaseSolarMutex();
static void AcquireSolarMutex( sal_uLong nCount );
@@ -397,7 +397,7 @@ class VCL_DLLPUBLIC SolarMutexGuard
private:
SolarMutexGuard( const SolarMutexGuard& );
const SolarMutexGuard& operator = ( const SolarMutexGuard& );
- ::osl::SolarMutex& m_solarMutex;
+ comphelper::SolarMutex& m_solarMutex;
public:
@@ -450,7 +450,7 @@ public:
}
}
protected:
- osl::SolarMutex& m_solarMutex;
+ comphelper::SolarMutex& m_solarMutex;
};
class VCL_DLLPUBLIC SolarMutexResettableGuard
@@ -496,7 +496,7 @@ public:
}
}
protected:
- osl::SolarMutex& m_solarMutex;
+ comphelper::SolarMutex& m_solarMutex;
};
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 07bc970..1b64286 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -884,7 +884,7 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject )
// This check is done after calling EndListening, so a later BroadcastUno call
// won't touch this object.
- osl::SolarMutex& rSolarMutex = Application::GetSolarMutex();
+ comphelper::SolarMutex& rSolarMutex = Application::GetSolarMutex();
if ( rSolarMutex.tryToAcquire() )
{
// BroadcastUno is always called with the SolarMutex locked, so if it
diff --git a/sfx2/source/doc/docstoragemodifylistener.cxx b/sfx2/source/doc/docstoragemodifylistener.cxx
index b3bf3b7..16a3b1c 100644
--- a/sfx2/source/doc/docstoragemodifylistener.cxx
+++ b/sfx2/source/doc/docstoragemodifylistener.cxx
@@ -18,7 +18,7 @@
*/
#include "sfx2/docstoragemodifylistener.hxx"
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
//........................................................................
namespace sfx2
@@ -40,7 +40,7 @@ namespace sfx2
//=
//====================================================================
//--------------------------------------------------------------------
- DocumentStorageModifyListener::DocumentStorageModifyListener( IModifiableDocument& _rDocument, ::osl::SolarMutex& _rMutex )
+ DocumentStorageModifyListener::DocumentStorageModifyListener( IModifiableDocument& _rDocument, comphelper::SolarMutex& _rMutex )
:m_pDocument( &_rDocument )
,m_rMutex( _rMutex )
{
@@ -54,14 +54,14 @@ namespace sfx2
//--------------------------------------------------------------------
void DocumentStorageModifyListener::dispose()
{
- ::osl::SolarGuard aGuard( m_rMutex );
+ ::osl::Guard< comphelper::SolarMutex > aGuard( m_rMutex );
m_pDocument = NULL;
}
//--------------------------------------------------------------------
void SAL_CALL DocumentStorageModifyListener::modified( const EventObject& /*aEvent*/ ) throw (RuntimeException)
{
- ::osl::SolarGuard aGuard( m_rMutex );
+ ::osl::Guard< comphelper::SolarMutex > aGuard( m_rMutex );
// storageIsModified must not contain any locking!
if ( m_pDocument )
m_pDocument->storageIsModified();
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 6beaa7b..78de8a7 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -81,9 +81,9 @@
#include <comphelper/evtmethodhelper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
+#include <comphelper/solarmutex.hxx>
#include <comphelper/string.hxx>
#include <connectivity/dbtools.hxx>
-#include <osl/mutex.hxx>
#include <rtl/logfile.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
@@ -837,7 +837,7 @@ void SAL_CALL FmXFormShell::propertyChange(const PropertyChangeEvent& evt) throw
// (Solche Paints passieren zum Beispiel, wenn man einfach nur eine andere Applikation ueber das Office legt und wieder
// zurueckschaltet).
// Deshalb die Benutzung des SolarMutex, der sichert das ab.
- ::osl::SolarMutex& rSolarSafety = Application::GetSolarMutex();
+ comphelper::SolarMutex& rSolarSafety = Application::GetSolarMutex();
if (rSolarSafety.tryToAcquire())
{
m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_RECORD_TOTAL , sal_True, sal_False);
diff --git a/sw/source/ui/inc/unodispatch.hxx b/sw/source/ui/inc/unodispatch.hxx
index 2ee0e01..26eb45d 100644
--- a/sw/source/ui/inc/unodispatch.hxx
+++ b/sw/source/ui/inc/unodispatch.hxx
@@ -27,6 +27,7 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx>
#include <list>
+#include <comphelper/solarmutex.hxx>
#include <osl/mutex.hxx>
class SwView;
@@ -41,7 +42,7 @@ class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3
class DispatchMutexLock_Impl
{
//::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently
- osl::SolarGuard aGuard;
+ osl::Guard< comphelper::SolarMutex > aGuard;
DispatchMutexLock_Impl();
public:
DispatchMutexLock_Impl(SwXDispatchProviderInterceptor&);
diff --git a/tools/source/misc/solarmutex.cxx b/tools/source/misc/solarmutex.cxx
index 515f083..f718999 100644
--- a/tools/source/misc/solarmutex.cxx
+++ b/tools/source/misc/solarmutex.cxx
@@ -21,9 +21,9 @@
namespace tools
{
- static ::osl::SolarMutex* pSolarMutex = 0;
+ static comphelper::SolarMutex* pSolarMutex = 0;
- void SolarMutex::SetSolarMutex( ::osl::SolarMutex* pMutex )
+ void SolarMutex::SetSolarMutex( comphelper::SolarMutex* pMutex )
{
pSolarMutex = pMutex;
}
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 5a3ad33..b97bbd5 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -102,7 +102,7 @@ class AquaDelayedSettingsChanged : public Timer
void AquaSalInstance::delayedSettingsChanged( bool bInvalidate )
{
- osl::SolarGuard aGuard( *mpSalYieldMutex );
+ osl::Guard< comphelper::SolarMutex > aGuard( *mpSalYieldMutex );
AquaDelayedSettingsChanged* pTimer = new AquaDelayedSettingsChanged( bInvalidate );
pTimer->SetTimeout( 50 );
pTimer->Start();
@@ -460,7 +460,7 @@ void AquaSalInstance::PostUserEvent( AquaSalFrame* pFrame, sal_uInt16 nType, voi
// -----------------------------------------------------------------------
-osl::SolarMutex* AquaSalInstance::GetYieldMutex()
+comphelper::SolarMutex* AquaSalInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index d8ccd17..2a35a4b 100644
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -161,7 +161,7 @@ static AquaSalFrame* getMouseContainerFrame()
{
if( GetSalData() && GetSalData()->mpFirstInstance )
{
- osl::SolarMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex();
+ comphelper::SolarMutex* pMutex = GetSalData()->mpFirstInstance->GetYieldMutex();
if( pMutex )
{
pMutex->acquire();
@@ -438,9 +438,9 @@ static AquaSalFrame* getMouseContainerFrame()
return NO;
}
-// helper class similar to a osl::SolarGuard for the SalYieldMutex
-// the difference is that it only does tryToAcquire instead of aquire
-// so dreaded deadlocks like #i93512# are prevented
+// helper class similar to a osl::Guard< comphelper::SolarMutex > for the
+// SalYieldMutex; the difference is that it only does tryToAcquire instead of
+// acquire so dreaded deadlocks like #i93512# are prevented
class TryGuard
{
public:
diff --git a/vcl/generic/app/geninst.cxx b/vcl/generic/app/geninst.cxx
index b5d309d..22a3975 100644
--- a/vcl/generic/app/geninst.cxx
+++ b/vcl/generic/app/geninst.cxx
@@ -63,19 +63,19 @@ void SalYieldMutex::release()
SolarMutexObject::release();
}
-sal_Bool SalYieldMutex::tryToAcquire()
+bool SalYieldMutex::tryToAcquire()
{
if ( SolarMutexObject::tryToAcquire() )
{
mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
- return sal_True;
+ return true;
}
else
- return sal_False;
+ return false;
}
-osl::SolarMutex* SalGenericInstance::GetYieldMutex()
+comphelper::SolarMutex* SalGenericInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 38e0777..f74d37d 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -174,7 +174,7 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
m_aTimeout = aTimeOfDay;
m_aTimeout += m_nTimeoutMS;
- osl::SolarGuard aGuard( mpSalYieldMutex );
+ osl::Guard< comphelper::SolarMutex > aGuard( mpSalYieldMutex );
// notify
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/inc/aqua/salinst.h b/vcl/inc/aqua/salinst.h
index 89469c7..441cbef 100644
--- a/vcl/inc/aqua/salinst.h
+++ b/vcl/inc/aqua/salinst.h
@@ -20,7 +20,7 @@
#ifndef _SV_SALINST_H
#define _SV_SALINST_H
-#include "osl/mutex.hxx"
+#include "comphelper/solarmutex.hxx"
#include "osl/thread.hxx"
#include "osl/conditn.h"
#include <vcl/solarmutex.hxx>
@@ -44,12 +44,12 @@ public:
SalYieldMutex();
virtual void acquire();
virtual void release();
- virtual sal_Bool tryToAcquire();
+ virtual bool tryToAcquire();
sal_uLong GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
-#define YIELD_GUARD osl::SolarGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
+#define YIELD_GUARD osl::Guard< comphelper::SolarMutex > aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
class AquaSalInstance : public SalInstance
@@ -107,7 +107,7 @@ public:
virtual SalI18NImeStatus* CreateI18NImeStatus();
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
- virtual osl::SolarMutex* GetYieldMutex();
+ virtual comphelper::SolarMutex* GetYieldMutex();
virtual sal_uLong ReleaseYieldMutex();
virtual void AcquireYieldMutex( sal_uLong nCount );
virtual bool CheckYieldMutex();
diff --git a/vcl/inc/generic/geninst.h b/vcl/inc/generic/geninst.h
index de47409..acbe1d4 100644
--- a/vcl/inc/generic/geninst.h
+++ b/vcl/inc/generic/geninst.h
@@ -58,7 +58,7 @@ public:
virtual void acquire();
virtual void release();
- virtual sal_Bool tryToAcquire();
+ virtual bool tryToAcquire();
virtual sal_uIntPtr GetAcquireCount() const { return mnCount; }
oslThreadIdentifier GetThreadId() const { return mnThreadId; }
@@ -81,7 +81,7 @@ public:
virtual ~SalGenericInstance();
// Yield mutex
- virtual osl::SolarMutex* GetYieldMutex();
+ virtual comphelper::SolarMutex* GetYieldMutex();
virtual sal_uIntPtr ReleaseYieldMutex();
virtual void AcquireYieldMutex( sal_uIntPtr nCount );
virtual bool CheckYieldMutex();
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index 73b7964..ca304ca 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -33,7 +33,7 @@
#include <list>
-
+namespace comphelper { class SolarMutex; }
struct SystemParentData;
struct SalPrinterQueueInfo;
struct ImplJobSetup;
@@ -111,7 +111,7 @@ public:
virtual SalBitmap* CreateSalBitmap() = 0;
// YieldMutex
- virtual osl::SolarMutex*
+ virtual comphelper::SolarMutex*
GetYieldMutex() = 0;
virtual sal_uLong ReleaseYieldMutex() = 0;
virtual void AcquireYieldMutex( sal_uLong nCount ) = 0;
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 6e35833..b9e510d 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -44,7 +44,7 @@ public:
GtkYieldMutex();
virtual void acquire();
virtual void release();
- virtual sal_Bool tryToAcquire() { return SalYieldMutex::tryToAcquire(); }
+ virtual bool tryToAcquire() { return SalYieldMutex::tryToAcquire(); }
void ThreadsEnter();
void ThreadsLeave();
diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h
index 5c3b038..7defd4a 100644
--- a/vcl/inc/win/salinst.h
+++ b/vcl/inc/win/salinst.h
@@ -59,7 +59,7 @@ public:
virtual SalI18NImeStatus* CreateI18NImeStatus();
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
- virtual osl::SolarMutex* GetYieldMutex();
+ virtual comphelper::SolarMutex* GetYieldMutex();
virtual sal_uIntPtr ReleaseYieldMutex();
virtual void AcquireYieldMutex( sal_uIntPtr nCount );
virtual bool CheckYieldMutex();
diff --git a/vcl/source/app/solarmutex.cxx b/vcl/source/app/solarmutex.cxx
index 7aba459..fb5f416 100644
--- a/vcl/source/app/solarmutex.cxx
+++ b/vcl/source/app/solarmutex.cxx
@@ -35,7 +35,7 @@ void SolarMutexObject::acquire()
osl_acquireMutex( m_solarMutex );
}
-sal_Bool SolarMutexObject::tryToAcquire()
+bool SolarMutexObject::tryToAcquire()
{
return osl_tryToAcquireMutex( m_solarMutex );
}
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index d04d1e2..8b3d149 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -63,7 +63,7 @@
#include "com/sun/star/awt/XToolkit.hpp"
#include "com/sun/star/uno/XNamingService.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "osl/mutex.hxx"
+#include "comphelper/solarmutex.hxx"
#include "osl/process.h"
#include <utility>
@@ -473,7 +473,7 @@ void Application::Quit()
// -----------------------------------------------------------------------
-osl::SolarMutex& Application::GetSolarMutex()
+comphelper::SolarMutex& Application::GetSolarMutex()
{
ImplSVData* pSVData = ImplGetSVData();
return *(pSVData->mpDefInst->GetYieldMutex());
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 5b79345..9cd2c0b 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -64,7 +64,7 @@
#include <osl/process.h>
#include <comphelper/processfactory.hxx>
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
#define DRAG_EVENT_MASK ButtonPressMask |\
ButtonReleaseMask |\
@@ -3308,7 +3308,7 @@ void SelectionManager::startDrag(
*/
if( nPointerGrabSuccess != GrabSuccess )
{
- osl::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
+ comphelper::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
if( rSolarMutex.tryToAcquire() )
{
pCaptureFrame = GetGenericData()->GetSalDisplay()->GetCaptureFrame();
@@ -3349,7 +3349,7 @@ void SelectionManager::startDrag(
listener->dragDropEnd( aDragFailedEvent );
if( pCaptureFrame )
{
- osl::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
+ comphelper::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
if( rSolarMutex.tryToAcquire() )
GetGenericData()->GetSalDisplay()->CaptureMouse( pCaptureFrame );
#if OSL_DEBUG_LEVEL > 0
@@ -3438,7 +3438,7 @@ void SelectionManager::startDrag(
if( pCaptureFrame )
{
- osl::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
+ comphelper::SolarMutex& rSolarMutex( Application::GetSolarMutex() );
if( rSolarMutex.tryToAcquire() )
GetGenericData()->GetSalDisplay()->CaptureMouse( pCaptureFrame );
#if OSL_DEBUG_LEVEL > 0
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index af7043a..6abb06b 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -825,7 +825,7 @@ extern "C" {
SalData *pSalData = GetSalData();
- osl::SolarGuard aGuard( pSalData->m_pInstance->GetYieldMutex() );
+ osl::Guard< comphelper::SolarMutex > aGuard( pSalData->m_pInstance->GetYieldMutex() );
sal_gtk_timeout_defer( pTSource );
@@ -911,7 +911,7 @@ gboolean GtkData::userEventFn( gpointer data )
gboolean bContinue = FALSE;
GtkData *pThis = (GtkData *) data;
SalGenericData *pData = GetGenericData();
- osl::SolarGuard aGuard( pData->m_pInstance->GetYieldMutex() );
+ osl::Guard< comphelper::SolarMutex > aGuard( pData->m_pInstance->GetYieldMutex() );
const SalGenericDisplay *pDisplay = pData->GetDisplay();
if (pDisplay)
{
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index ef43804..7da838c 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -23,7 +23,7 @@
#include <process.h>
#include <osl/file.hxx>
-#include <osl/mutex.hxx>
+#include <comphelper/solarmutex.hxx>
#include <tools/solarmutex.hxx>
@@ -107,9 +107,9 @@ public: // for ImplSalYield()
public:
SalYieldMutex( WinSalInstance* pInstData );
- virtual void SAL_CALL acquire();
- virtual void SAL_CALL release();
- virtual sal_Bool SAL_CALL tryToAcquire();
+ virtual void acquire();
+ virtual void release();
+ virtual bool tryToAcquire();
sal_uLong GetAcquireCount( sal_uLong nThreadId );
};
@@ -125,7 +125,7 @@ SalYieldMutex::SalYieldMutex( WinSalInstance* pInstData )
// -----------------------------------------------------------------------
-void SAL_CALL SalYieldMutex::acquire()
+void SalYieldMutex::acquire()
{
SolarMutexObject::acquire();
mnCount++;
@@ -134,7 +134,7 @@ void SAL_CALL SalYieldMutex::acquire()
// -----------------------------------------------------------------------
-void SAL_CALL SalYieldMutex::release()
+void SalYieldMutex::release()
{
DWORD nThreadId = GetCurrentThreadId();
if ( mnThreadId != nThreadId )
@@ -176,16 +176,16 @@ void SAL_CALL SalYieldMutex::release()
// -----------------------------------------------------------------------
-sal_Bool SAL_CALL SalYieldMutex::tryToAcquire()
+bool SalYieldMutex::tryToAcquire()
{
if( SolarMutexObject::tryToAcquire() )
{
mnCount++;
mnThreadId = GetCurrentThreadId();
- return sal_True;
+ return true;
}
else
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
@@ -593,7 +593,7 @@ WinSalInstance::~WinSalInstance()
// -----------------------------------------------------------------------
-osl::SolarMutex* WinSalInstance::GetYieldMutex()
+comphelper::SolarMutex* WinSalInstance::GetYieldMutex()
{
return mpSalYieldMutex;
}
More information about the Libreoffice-commits
mailing list