Kaydet (Commit) 9baa3cf7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use an osl::Mutex directly

Change-Id: I22d6d17bbd6886733df645e4d217c6fd1d995929
üst 3a94a46f
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_JOBS_HELPONSTARTUP_HXX
#define INCLUDED_FRAMEWORK_INC_JOBS_HELPONSTARTUP_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
......@@ -45,13 +44,12 @@ namespace framework{
@author as96863
*/
class HelpOnStartup : private ThreadHelpBase
,public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::lang::XEventListener,::com::sun::star::task::XJob >
class HelpOnStartup : public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XServiceInfo,::com::sun::star::lang::XEventListener,::com::sun::star::task::XJob >
{
// member
private:
osl::Mutex m_mutex;
/** @short reference to an uno service manager. */
css::uno::Reference< css::uno::XComponentContext > m_xContext;
......
......@@ -21,7 +21,6 @@
// include own header
#include <jobs/helponstartup.hxx>
#include <threadhelp/guard.hxx>
#include <loadenv/targethelper.hxx>
#include <services.h>
......@@ -101,8 +100,7 @@ DEFINE_INIT_SERVICE(HelpOnStartup,
HelpOnStartup::HelpOnStartup(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: ThreadHelpBase( )
, m_xContext (xContext)
: m_xContext (xContext)
{
}
......@@ -163,18 +161,13 @@ css::uno::Any SAL_CALL HelpOnStartup::execute(const css::uno::Sequence< css::bea
void SAL_CALL HelpOnStartup::disposing(const css::lang::EventObject& aEvent)
throw(css::uno::RuntimeException, std::exception)
{
// SAFE ->
Guard aLock(m_aLock);
osl::MutexGuard g(m_mutex);
if (aEvent.Source == m_xModuleManager)
m_xModuleManager.clear();
else if (aEvent.Source == m_xDesktop)
m_xDesktop.clear();
else if (aEvent.Source == m_xConfig)
m_xConfig.clear();
aLock.unlock();
// <- SAFE
}
......@@ -211,9 +204,9 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const css::uno::Sequence< css::be
// OK - now we are sure this document is a top level document.
// Classify it.
// SAFE ->
Guard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_mutex);
css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = m_xModuleManager;
aLock.unlock();
aLock.clear();
// <- SAFE
OUString sModuleId;
......@@ -233,9 +226,9 @@ OUString HelpOnStartup::its_getModuleIdFromEnv(const css::uno::Sequence< css::be
OUString HelpOnStartup::its_getCurrentHelpURL()
{
// SAFE ->
Guard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_mutex);
css::uno::Reference< css::frame::XDesktop2 > xDesktop = m_xDesktop;
aLock.unlock();
aLock.clear();
// <- SAFE
if (!xDesktop.is())
......@@ -278,11 +271,11 @@ OUString HelpOnStartup::its_getCurrentHelpURL()
return sal_False;
// SAFE ->
Guard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_mutex);
css::uno::Reference< css::container::XNameAccess > xConfig = m_xConfig;
OUString sLocale = m_sLocale;
OUString sSystem = m_sSystem;
aLock.unlock();
aLock.clear();
// <- SAFE
if (!xConfig.is())
......@@ -322,11 +315,11 @@ OUString HelpOnStartup::its_getCurrentHelpURL()
OUString HelpOnStartup::its_checkIfHelpEnabledAndGetURL(const OUString& sModule)
{
// SAFE ->
Guard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_mutex);
css::uno::Reference< css::container::XNameAccess > xConfig = m_xConfig;
OUString sLocale = m_sLocale;
OUString sSystem = m_sSystem;
aLock.unlock();
aLock.clear();
// <- SAFE
OUString sHelpURL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment