summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-20 10:39:33 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-20 10:49:40 +0100
commit8781cdcc5b798ae2bdf3edba34b335d068339d4e (patch)
tree0da3f6c50070700aa27ae07bcedb118ed93044ba /framework
parent35c495fd78b0d59aef035273e49c174fdc05f407 (diff)
Use an osl::Mutex directly
Change-Id: I5dc6e56bcbec5055da629d4dfda608f266191ef9
Diffstat (limited to 'framework')
-rw-r--r--framework/source/loadenv/loadenv.cxx32
1 files changed, 6 insertions, 26 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 8079c4b5bf9d..1b074907cd07 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -93,12 +93,11 @@ namespace framework {
using namespace com::sun::star;
-class LoadEnvListener : private ThreadHelpBase
- , public ::cppu::WeakImplHelper2< css::frame::XLoadEventListener ,
+class LoadEnvListener : public ::cppu::WeakImplHelper2< css::frame::XLoadEventListener ,
css::frame::XDispatchResultListener >
{
private:
-
+ osl::Mutex m_mutex;
bool m_bWaitingResult;
LoadEnv* m_pLoadEnv;
@@ -469,38 +468,27 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::getTargetComponent() const
void SAL_CALL LoadEnvListener::loadFinished(const css::uno::Reference< css::frame::XFrameLoader >&)
throw(css::uno::RuntimeException, std::exception)
{
- // SAFE -> ----------------------------------
- Guard aWriteLock(m_aLock);
-
+ osl::MutexGuard g(m_mutex);
if (m_bWaitingResult)
m_pLoadEnv->impl_setResult(sal_True);
m_bWaitingResult = false;
-
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
}
void SAL_CALL LoadEnvListener::loadCancelled(const css::uno::Reference< css::frame::XFrameLoader >&)
throw(css::uno::RuntimeException, std::exception)
{
- // SAFE -> ----------------------------------
- Guard aWriteLock(m_aLock);
-
+ osl::MutexGuard g(m_mutex);
if (m_bWaitingResult)
m_pLoadEnv->impl_setResult(sal_False);
m_bWaitingResult = false;
-
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
}
void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResultEvent& aEvent)
throw(css::uno::RuntimeException, std::exception)
{
- // SAFE -> ----------------------------------
- Guard aWriteLock(m_aLock);
+ osl::MutexGuard g(m_mutex);
if (!m_bWaitingResult)
return;
@@ -520,24 +508,16 @@ void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResult
break;
}
m_bWaitingResult = false;
-
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
}
void SAL_CALL LoadEnvListener::disposing(const css::lang::EventObject&)
throw(css::uno::RuntimeException, std::exception)
{
- // SAFE -> ----------------------------------
- Guard aWriteLock(m_aLock);
-
+ osl::MutexGuard g(m_mutex);
if (m_bWaitingResult)
m_pLoadEnv->impl_setResult(sal_False);
m_bWaitingResult = false;
-
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
}