desktop/inc/dp_misc.h                                                 |    8 
----
 desktop/source/deployment/dp_log.cxx                                  |    5 +-
 desktop/source/deployment/manager/dp_extensionmanager.cxx             |   20 
+++++-----
 desktop/source/deployment/manager/dp_extensionmanager.hxx             |    3 +
 desktop/source/deployment/manager/dp_manager.cxx                      |   10 
++---
 desktop/source/deployment/manager/dp_manager.h                        |    7 
++-
 desktop/source/deployment/manager/dp_managerfac.cxx                   |   10 
++---
 desktop/source/deployment/registry/component/dp_component.cxx         |   16 
++++----
 desktop/source/deployment/registry/configuration/dp_configuration.cxx |    6 
+--
 desktop/source/deployment/registry/dp_backend.cxx                     |   16 
++++----
 desktop/source/deployment/registry/dp_registry.cxx                    |    7 
++-
 desktop/source/deployment/registry/inc/dp_backend.h                   |    5 +-
 desktop/source/deployment/registry/package/dp_package.cxx             |    2 -
 13 files changed, 56 insertions(+), 59 deletions(-)

New commits:
commit 2e1cf05f3b1a7d111c538a2588e891aad67792bb
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Dec 18 09:48:44 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Dec 19 11:19:38 2021 +0100

    use more cppu::BaseMutex
    
    Change-Id: Ida7f6b536f5c07c929ddb21c97be6e9dc4a2b2f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127080
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/desktop/inc/dp_misc.h b/desktop/inc/dp_misc.h
index 0d9eadb90cb3..4a5c27933b7c 100644
--- a/desktop/inc/dp_misc.h
+++ b/desktop/inc/dp_misc.h
@@ -36,14 +36,6 @@ const char CR = 0x0d;
 const char LF = 0x0a;
 
 
-class MutexHolder
-{
-    mutable ::osl::Mutex m_mutex;
-protected:
-    ::osl::Mutex & getMutex() const { return m_mutex; }
-};
-
-
 inline void try_dispose( css::uno::Reference< css::uno::XInterface> const & x )
 {
     css::uno::Reference< css::lang::XComponent> xComp( x, css::uno::UNO_QUERY 
);
diff --git a/desktop/source/deployment/dp_log.cxx 
b/desktop/source/deployment/dp_log.cxx
index c184224747be..64c10183b58b 100644
--- a/desktop/source/deployment/dp_log.cxx
+++ b/desktop/source/deployment/dp_log.cxx
@@ -19,6 +19,7 @@
 
 
 #include <dp_misc.h>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <comphelper/anytostring.hxx>
@@ -38,7 +39,7 @@ typedef 
::cppu::WeakComponentImplHelper<ucb::XProgressHandler, lang::XServiceInf
 
 namespace {
 
-class ProgressLogImpl : public ::dp_misc::MutexHolder, public t_log_helper
+class ProgressLogImpl : public cppu::BaseMutex, public t_log_helper
 {
     std::unique_ptr<comphelper::EventLogger> m_logger;
 
@@ -76,7 +77,7 @@ void ProgressLogImpl::disposing()
 ProgressLogImpl::ProgressLogImpl(
     Sequence<Any> const & /* args */,
     Reference<XComponentContext> const & xContext )
-    : t_log_helper( getMutex() )
+    : t_log_helper( m_aMutex )
 {
     // Use the logger created by unopkg app
     m_logger.reset(new comphelper::EventLogger(xContext, "unopkg"));
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx 
b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index f9232f0e36f1..f9a878e8f1cb 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -156,7 +156,7 @@ namespace dp_manager {
 
 //ToDo: bundled extension
 ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& 
xContext) :
-    ::cppu::WeakComponentImplHelper< css::deployment::XExtensionManager, 
css::lang::XServiceInfo >(getMutex())
+    ::cppu::WeakComponentImplHelper< css::deployment::XExtensionManager, 
css::lang::XServiceInfo >(m_aMutex)
     , m_xContext(xContext)
 {
     m_xPackageManagerFactory = 
css::deployment::thePackageManagerFactory::get(m_xContext);
@@ -669,7 +669,7 @@ Reference<css::deployment::XPackage> 
ExtensionManager::addExtension(
         // http://qa.openoffice.org/issues/show_bug.cgi?id=114933
         // By not providing xCmdEnv the underlying APIs will throw an 
exception if
         // the XInteractionRequest cannot be handled.
-        ::osl::MutexGuard guard(getMutex());
+        ::osl::MutexGuard guard(m_aMutex);
 
         if (bCanInstall)
         {
@@ -826,7 +826,7 @@ void ExtensionManager::removeExtension(
     Reference<css::deployment::XPackage> xExtensionBackup;
     Reference<css::deployment::XPackageManager> xPackageManager;
     bool bUserDisabled = false;
-    ::osl::MutexGuard guard(getMutex());
+    ::osl::MutexGuard guard(m_aMutex);
     try
     {
 //Determine the repository to use
@@ -916,7 +916,7 @@ void ExtensionManager::enableExtension(
     Reference<task::XAbortChannel> const & xAbortChannel,
     Reference<ucb::XCommandEnvironment> const & xCmdEnv)
 {
-    ::osl::MutexGuard guard(getMutex());
+    ::osl::MutexGuard guard(m_aMutex);
     bool bUserDisabled = false;
     uno::Any excOccurred;
     try
@@ -978,7 +978,7 @@ sal_Int32 ExtensionManager::checkPrerequisitesAndEnable(
     {
         if (!extension.is())
             return 0;
-        ::osl::MutexGuard guard(getMutex());
+        ::osl::MutexGuard guard(m_aMutex);
         sal_Int32 ret = 0;
         Reference<css::deployment::XPackageManager> mgr =
             getPackageManager(extension->getRepositoryName());
@@ -1018,7 +1018,7 @@ void ExtensionManager::disableExtension(
     Reference<task::XAbortChannel> const & xAbortChannel,
     Reference<ucb::XCommandEnvironment> const & xCmdEnv )
 {
-    ::osl::MutexGuard guard(getMutex());
+    ::osl::MutexGuard guard(m_aMutex);
     uno::Any excOccurred;
     bool bUserDisabled = false;
     try
@@ -1187,7 +1187,7 @@ void ExtensionManager::reinstallDeployedExtensions(
             }
         }
 
-        ::osl::MutexGuard guard(getMutex());
+        ::osl::MutexGuard guard(m_aMutex);
         xPackageManager->reinstallDeployedPackages(
             force, xAbortChannel, xCmdEnv);
         //We must sync here, otherwise we will get exceptions when extensions
@@ -1235,7 +1235,7 @@ sal_Bool ExtensionManager::synchronize(
 {
     try
     {
-        ::osl::MutexGuard guard(getMutex());
+        ::osl::MutexGuard guard(m_aMutex);
         OUString sSynchronizingShared(StrSyncRepository());
         sSynchronizingShared = sSynchronizingShared.replaceAll("%NAME", 
"shared");
         dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared);
@@ -1369,7 +1369,7 @@ ExtensionManager::getExtensionsWithUnacceptedLicenses(
 {
     Reference<css::deployment::XPackageManager>
         xPackageManager = getPackageManager(repository);
-    ::osl::MutexGuard guard(getMutex());
+    ::osl::MutexGuard guard(m_aMutex);
     return xPackageManager->getExtensionsWithUnacceptedLicenses(xCmdEnv);
 }
 
@@ -1398,7 +1398,7 @@ void ExtensionManager::removeModifyListener(
 
 void ExtensionManager::check()
 {
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if (rBHelper.bInDispose || rBHelper.bDisposed) {
         throw lang::DisposedException(
             "ExtensionManager instance has already been disposed!",
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx 
b/desktop/source/deployment/manager/dp_extensionmanager.hxx
index aeee0d15683a..348b0cc4e68f 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.hxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -22,6 +22,7 @@
 #include <strings.hrc>
 #include <dp_misc.h>
 #include <dp_shared.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <com/sun/star/deployment/XExtensionManager.hpp>
 #include <com/sun/star/deployment/XPackageManager.hpp>
@@ -37,7 +38,7 @@ typedef std::unordered_map<
     OUString,
     std::vector<css::uno::Reference<css::deployment::XPackage> > > 
id2extensions;
 
-class ExtensionManager : private ::dp_misc::MutexHolder,
+class ExtensionManager : private cppu::BaseMutex,
         public ::cppu::WeakComponentImplHelper< 
css::deployment::XExtensionManager, css::lang::XServiceInfo >
 {
 public:
diff --git a/desktop/source/deployment/manager/dp_manager.cxx 
b/desktop/source/deployment/manager/dp_manager.cxx
index bd68c26a9512..54ac26282750 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -668,7 +668,7 @@ void PackageManagerImpl::insertToActivationLayerDB(
     OUString const & id, ActivePackages::Data const & dbData )
 {
     //access to the database must be guarded. See removePackage
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     m_activePackagesDB->put( id, dbData );
 }
 
@@ -871,7 +871,7 @@ void PackageManagerImpl::removePackage(
     try {
         Reference<deployment::XPackage> xPackage;
         {
-            const ::osl::MutexGuard guard(getMutex());
+            const ::osl::MutexGuard guard(m_aMutex);
             //Check if this extension exist and throw an 
IllegalArgumentException
             //if it does not
             //If the files of the extension are already removed, or there is a
@@ -1051,7 +1051,7 @@ Reference<deployment::XPackage> 
PackageManagerImpl::getDeployedPackage(
         xCmdEnv.set( xCmdEnv_ );
 
     try {
-        const ::osl::MutexGuard guard( getMutex() );
+        const ::osl::MutexGuard guard( m_aMutex );
         return getDeployedPackage_( id, fileName, xCmdEnv );
     }
     catch (const RuntimeException &) {
@@ -1089,7 +1089,7 @@ PackageManagerImpl::getDeployedPackages(
         xCmdEnv.set( xCmdEnv_ );
 
     try {
-        const ::osl::MutexGuard guard( getMutex() );
+        const ::osl::MutexGuard guard( m_aMutex );
         return getDeployedPackages_( xCmdEnv );
     }
     catch (const RuntimeException &) {
@@ -1428,7 +1428,7 @@ Sequence< Reference<deployment::XPackage> > 
PackageManagerImpl::getExtensionsWit
 
     try
     {
-        const ::osl::MutexGuard guard( getMutex() );
+        const ::osl::MutexGuard guard( m_aMutex );
         // clean up activation layer, scan for zombie temp dirs:
         ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() );
 
diff --git a/desktop/source/deployment/manager/dp_manager.h 
b/desktop/source/deployment/manager/dp_manager.h
index ec34461aa6f7..fbcc2d594861 100644
--- a/desktop/source/deployment/manager/dp_manager.h
+++ b/desktop/source/deployment/manager/dp_manager.h
@@ -21,6 +21,7 @@
 
 #include <dp_misc.h>
 #include "dp_activepackages.hxx"
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <ucbhelper/content.hxx>
@@ -35,7 +36,7 @@ typedef ::cppu::WeakComponentImplHelper<
     css::deployment::XPackageManager > t_pm_helper;
 
 
-class PackageManagerImpl final : private ::dp_misc::MutexHolder, public 
t_pm_helper
+class PackageManagerImpl final : private cppu::BaseMutex, public t_pm_helper
 {
     css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
     OUString m_context;
@@ -118,7 +119,7 @@ class PackageManagerImpl final : private 
::dp_misc::MutexHolder, public t_pm_hel
     PackageManagerImpl(
         css::uno::Reference<css::uno::XComponentContext>
         const & xComponentContext, OUString const & context )
-        : t_pm_helper( getMutex() ),
+        : t_pm_helper( m_aMutex ),
           m_xComponentContext( xComponentContext ),
           m_context( context ),
           m_readOnly( true )
@@ -213,7 +214,7 @@ public:
 
 inline void PackageManagerImpl::check()
 {
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if (rBHelper.bInDispose || rBHelper.bDisposed)
         throw css::lang::DisposedException(
             "PackageManager instance has already been disposed!",
diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx 
b/desktop/source/deployment/manager/dp_managerfac.cxx
index ada9a9c3a9e5..cd96699caec1 100644
--- a/desktop/source/deployment/manager/dp_managerfac.cxx
+++ b/desktop/source/deployment/manager/dp_managerfac.cxx
@@ -36,7 +36,7 @@ typedef ::cppu::WeakComponentImplHelper<
 
 namespace {
 
-class PackageManagerFactoryImpl : private MutexHolder, public t_pmfac_helper
+class PackageManagerFactoryImpl : private cppu::BaseMutex, public 
t_pmfac_helper
 {
     Reference<XComponentContext> m_xComponentContext;
 
@@ -71,7 +71,7 @@ public:
 
 PackageManagerFactoryImpl::PackageManagerFactoryImpl(
     Reference<XComponentContext> const & xComponentContext )
-    : t_pmfac_helper( getMutex() ),
+    : t_pmfac_helper( m_aMutex ),
       m_xComponentContext( xComponentContext )
 {
 }
@@ -95,7 +95,7 @@ css::uno::Sequence< OUString > 
PackageManagerFactoryImpl::getSupportedServiceNam
 
 inline void PackageManagerFactoryImpl::check()
 {
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if (rBHelper.bInDispose || rBHelper.bDisposed)
     {
         throw lang::DisposedException(
@@ -108,7 +108,7 @@ inline void PackageManagerFactoryImpl::check()
 void PackageManagerFactoryImpl::disposing()
 {
     // dispose all managers:
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     for (auto const& elem : m_managers)
         try_dispose( elem.second );
     m_managers = t_string2weakref();
@@ -126,7 +126,7 @@ Reference<deployment::XPackageManager>
 PackageManagerFactoryImpl::getPackageManager( OUString const & context )
 {
     Reference< deployment::XPackageManager > xRet;
-    ::osl::ResettableMutexGuard guard( getMutex() );
+    ::osl::ResettableMutexGuard guard( m_aMutex );
     check();
     t_string2weakref::const_iterator const iFind( m_managers.find( context ) );
     if (iFind != m_managers.end()) {
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx 
b/desktop/source/deployment/registry/component/dp_component.cxx
index 95bf25489147..f154134678f5 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -352,7 +352,7 @@ BackendImpl::ComponentPackageImpl::getRDB() const
     //would otherwise cause problems when copying the rdbs.
     //See  http://qa.openoffice.org/issues/show_bug.cgi?id=99257
     {
-        const ::osl::MutexGuard guard( getMutex() );
+        const ::osl::MutexGuard guard( m_aMutex );
         if (!that->bSwitchedRdbFiles)
         {
             that->bSwitchedRdbFiles = true;
@@ -733,7 +733,7 @@ void BackendImpl::unorc_verify_init(
 {
     if (transientMode())
         return;
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     if ( m_unorc_inited)
         return;
 
@@ -972,7 +972,7 @@ void BackendImpl::addToUnoRc( RcItem kind, OUString const & 
url_,
                               Reference<XCommandEnvironment> const & xCmdEnv )
 {
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     unorc_verify_init( xCmdEnv );
     std::deque<OUString> & rSet = getRcItemList(kind);
     if (std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) {
@@ -989,7 +989,7 @@ void BackendImpl::removeFromUnoRc(
     Reference<XCommandEnvironment> const & xCmdEnv )
 {
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     unorc_verify_init( xCmdEnv );
     std::deque<OUString> & aRcItemList = getRcItemList(kind);
     aRcItemList.erase(std::remove(aRcItemList.begin(), aRcItemList.end(), 
rcterm), aRcItemList.end());
@@ -1003,7 +1003,7 @@ bool BackendImpl::hasInUnoRc(
     RcItem kind, OUString const & url_ )
 {
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     std::deque<OUString> const & rSet = getRcItemList(kind);
     return std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end();
 }
@@ -1020,14 +1020,14 @@ css::uno::Reference< css::uno::XComponentContext > 
BackendImpl::getRootContext()
 
 void BackendImpl::releaseObject( OUString const & id )
 {
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     m_backendObjects.erase( id );
 }
 
 
 Reference<XInterface> BackendImpl::getObject( OUString const & id )
 {
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     const t_string2object::const_iterator iFind( m_backendObjects.find( id ) );
     if (iFind == m_backendObjects.end())
         return Reference<XInterface>();
@@ -1039,7 +1039,7 @@ Reference<XInterface> BackendImpl::getObject( OUString 
const & id )
 Reference<XInterface> BackendImpl::insertObject(
     OUString const & id, Reference<XInterface> const & xObject )
 {
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     const std::pair<t_string2object::iterator, bool> insertion(
         m_backendObjects.emplace( id, xObject ) );
     return insertion.first->second;
diff --git 
a/desktop/source/deployment/registry/configuration/dp_configuration.cxx 
b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 4b388414a778..a4f19bf6d875 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -367,7 +367,7 @@ void BackendImpl::configmgrini_verify_init(
 {
     if (transientMode())
         return;
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     if ( m_configmgrini_inited)
         return;
 
@@ -478,7 +478,7 @@ void BackendImpl::addToConfigmgrIni( bool isSchema, bool 
isURL, OUString const &
                               Reference<XCommandEnvironment> const & xCmdEnv )
 {
     const OUString rcterm( isURL ? dp_misc::makeRcTerm(url_) : url_ );
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     configmgrini_verify_init( xCmdEnv );
     std::deque<OUString> & rSet = getFiles(isSchema);
     if (std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) {
@@ -495,7 +495,7 @@ bool BackendImpl::removeFromConfigmgrIni(
     Reference<XCommandEnvironment> const & xCmdEnv )
 {
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
-    const ::osl::MutexGuard guard( getMutex() );
+    const ::osl::MutexGuard guard( m_aMutex );
     configmgrini_verify_init( xCmdEnv );
     std::deque<OUString> & rSet = getFiles(isSchema);
     auto i(std::find(rSet.begin(), rSet.end(), rcterm));
diff --git a/desktop/source/deployment/registry/dp_backend.cxx 
b/desktop/source/deployment/registry/dp_backend.cxx
index 6e972744846d..58e689e9f2eb 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -63,7 +63,7 @@ void PackageRegistryBackend::disposing( lang::EventObject 
const & event )
     Reference<deployment::XPackage> xPackage(
         event.Source, UNO_QUERY_THROW );
     OUString url( xPackage->getURL() );
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if ( m_bound.erase( url ) != 1 )
     {
         SAL_WARN("desktop.deployment", "erase(" << url << ") != 1");
@@ -74,7 +74,7 @@ void PackageRegistryBackend::disposing( lang::EventObject 
const & event )
 PackageRegistryBackend::PackageRegistryBackend(
     Sequence<Any> const & args,
     Reference<XComponentContext> const & xContext )
-    : t_BackendBase( getMutex() ),
+    : t_BackendBase( m_aMutex ),
       m_xComponentContext( xContext ),
       m_eContext( Context::Unknown )
 {
@@ -102,7 +102,7 @@ PackageRegistryBackend::PackageRegistryBackend(
 
 void PackageRegistryBackend::check()
 {
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if (rBHelper.bInDispose || rBHelper.bDisposed) {
         throw lang::DisposedException(
             "PackageRegistryBackend instance has already been disposed!",
@@ -137,7 +137,7 @@ Reference<deployment::XPackage> 
PackageRegistryBackend::bindPackage(
     OUString const & url, OUString const & mediaType, sal_Bool  bRemoved,
     OUString const & identifier, Reference<XCommandEnvironment> const & 
xCmdEnv )
 {
-    ::osl::ResettableMutexGuard guard( getMutex() );
+    ::osl::ResettableMutexGuard guard( m_aMutex );
     check();
 
     t_string2ref::const_iterator const iFind( m_bound.find( url ) );
@@ -303,7 +303,7 @@ Package::Package( ::rtl::Reference<PackageRegistryBackend> 
const & myBackend,
                   Reference<deployment::XPackageTypeInfo> const & xPackageType,
                   bool bRemoved,
                   OUString const & identifier)
-    : t_PackageBase( getMutex() ),
+    : t_PackageBase( m_aMutex ),
       m_myBackend( myBackend ),
       m_url( url ),
       m_name( rName ),
@@ -335,7 +335,7 @@ void Package::disposing()
 
 void Package::check() const
 {
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if (rBHelper.bInDispose || rBHelper.bDisposed) {
         throw lang::DisposedException(
             "Package instance has already been disposed!",
@@ -574,7 +574,7 @@ beans::Optional< beans::Ambiguous<sal_Bool> > 
Package::isRegistered(
     Reference<XCommandEnvironment> const & xCmdEnv )
 {
     try {
-        ::osl::ResettableMutexGuard guard( getMutex() );
+        ::osl::ResettableMutexGuard guard( m_aMutex );
         return isRegistered_( guard,
                               AbortChannel::get(xAbortChannel),
                               xCmdEnv );
@@ -611,7 +611,7 @@ void Package::processPackage_impl(
 
     try {
         try {
-            ::osl::ResettableMutexGuard guard( getMutex() );
+            ::osl::ResettableMutexGuard guard( m_aMutex );
             beans::Optional< beans::Ambiguous<sal_Bool> > option(
                 isRegistered_( guard, AbortChannel::get(xAbortChannel),
                                xCmdEnv ) );
diff --git a/desktop/source/deployment/registry/dp_registry.cxx 
b/desktop/source/deployment/registry/dp_registry.cxx
index 10e155f40d4f..40239f2501b2 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -29,6 +29,7 @@
 #include <osl/diagnose.h>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/uri.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <comphelper/sequence.hxx>
 #include <ucbhelper/content.hxx>
@@ -62,7 +63,7 @@ typedef ::cppu::WeakComponentImplHelper<
     deployment::XPackageRegistry, util::XUpdatable > t_helper;
 
 
-class PackageRegistryImpl : private MutexHolder, public t_helper
+class PackageRegistryImpl : private cppu::BaseMutex, public t_helper
 {
     struct ci_string_hash {
         std::size_t operator () ( OUString const & str ) const {
@@ -97,7 +98,7 @@ protected:
     virtual void SAL_CALL disposing() override;
 
     virtual ~PackageRegistryImpl() override;
-    PackageRegistryImpl() : t_helper( getMutex() ) {}
+    PackageRegistryImpl() : t_helper( m_aMutex ) {}
 
 
 public:
@@ -122,7 +123,7 @@ public:
 
 void PackageRegistryImpl::check()
 {
-    ::osl::MutexGuard guard( getMutex() );
+    ::osl::MutexGuard guard( m_aMutex );
     if (rBHelper.bInDispose || rBHelper.bDisposed) {
         throw lang::DisposedException(
             "PackageRegistry instance has already been disposed!",
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h 
b/desktop/source/deployment/registry/inc/dp_backend.h
index e398b0a802f0..4a9353bf415a 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -23,6 +23,7 @@
 #include <dp_shared.hxx>
 #include <dp_interact.h>
 #include <rtl/ref.hxx>
+#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <com/sun/star/lang/XEventListener.hpp>
@@ -42,7 +43,7 @@ typedef ::cppu::WeakComponentImplHelper<
     css::deployment::XPackage > t_PackageBase;
 
 
-class Package : protected ::dp_misc::MutexHolder, public t_PackageBase
+class Package : protected cppu::BaseMutex, public t_PackageBase
 {
     PackageRegistryBackend * getMyBackend() const;
     void processPackage_impl(
@@ -192,7 +193,7 @@ typedef ::cppu::WeakComponentImplHelper<
 
 
 class PackageRegistryBackend
-    : protected ::dp_misc::MutexHolder, public t_BackendBase
+    : protected cppu::BaseMutex, public t_BackendBase
 {
     //The map held originally WeakReferences. The map entries are removed in 
the disposing
     //function, which is called when the XPackages are destructed or they are
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx 
b/desktop/source/deployment/registry/package/dp_package.cxx
index f69919c3b50c..09dc1331d4ef 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -1249,7 +1249,7 @@ Sequence< Reference<deployment::XPackage> > 
BackendImpl::PackageImpl::getBundle(
         }
         OSL_ASSERT( lower_end == upper_end );
 
-        const ::osl::MutexGuard guard( getMutex() );
+        const ::osl::MutexGuard guard( m_aMutex );
         pBundle = m_pBundle;
         if (pBundle == nullptr) {
             m_bundle = ret;

Reply via email to