Kaydet (Commit) 8781cdcc authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use an osl::Mutex directly

Change-Id: I5dc6e56bcbec5055da629d4dfda608f266191ef9
üst 35c495fd
...@@ -93,12 +93,11 @@ namespace framework { ...@@ -93,12 +93,11 @@ namespace framework {
using namespace com::sun::star; using namespace com::sun::star;
class LoadEnvListener : private ThreadHelpBase class LoadEnvListener : public ::cppu::WeakImplHelper2< css::frame::XLoadEventListener ,
, public ::cppu::WeakImplHelper2< css::frame::XLoadEventListener ,
css::frame::XDispatchResultListener > css::frame::XDispatchResultListener >
{ {
private: private:
osl::Mutex m_mutex;
bool m_bWaitingResult; bool m_bWaitingResult;
LoadEnv* m_pLoadEnv; LoadEnv* m_pLoadEnv;
...@@ -469,38 +468,27 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::getTargetComponent() const ...@@ -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 >&) void SAL_CALL LoadEnvListener::loadFinished(const css::uno::Reference< css::frame::XFrameLoader >&)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
// SAFE -> ---------------------------------- osl::MutexGuard g(m_mutex);
Guard aWriteLock(m_aLock);
if (m_bWaitingResult) if (m_bWaitingResult)
m_pLoadEnv->impl_setResult(sal_True); m_pLoadEnv->impl_setResult(sal_True);
m_bWaitingResult = false; m_bWaitingResult = false;
aWriteLock.unlock();
// <- SAFE ----------------------------------
} }
void SAL_CALL LoadEnvListener::loadCancelled(const css::uno::Reference< css::frame::XFrameLoader >&) void SAL_CALL LoadEnvListener::loadCancelled(const css::uno::Reference< css::frame::XFrameLoader >&)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
// SAFE -> ---------------------------------- osl::MutexGuard g(m_mutex);
Guard aWriteLock(m_aLock);
if (m_bWaitingResult) if (m_bWaitingResult)
m_pLoadEnv->impl_setResult(sal_False); m_pLoadEnv->impl_setResult(sal_False);
m_bWaitingResult = false; m_bWaitingResult = false;
aWriteLock.unlock();
// <- SAFE ----------------------------------
} }
void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResultEvent& aEvent) void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResultEvent& aEvent)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
// SAFE -> ---------------------------------- osl::MutexGuard g(m_mutex);
Guard aWriteLock(m_aLock);
if (!m_bWaitingResult) if (!m_bWaitingResult)
return; return;
...@@ -520,24 +508,16 @@ void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResult ...@@ -520,24 +508,16 @@ void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResult
break; break;
} }
m_bWaitingResult = false; m_bWaitingResult = false;
aWriteLock.unlock();
// <- SAFE ----------------------------------
} }
void SAL_CALL LoadEnvListener::disposing(const css::lang::EventObject&) void SAL_CALL LoadEnvListener::disposing(const css::lang::EventObject&)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
// SAFE -> ---------------------------------- osl::MutexGuard g(m_mutex);
Guard aWriteLock(m_aLock);
if (m_bWaitingResult) if (m_bWaitingResult)
m_pLoadEnv->impl_setResult(sal_False); m_pLoadEnv->impl_setResult(sal_False);
m_bWaitingResult = false; m_bWaitingResult = false;
aWriteLock.unlock();
// <- SAFE ----------------------------------
} }
......
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