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

Use an osl::Mutex directly

Change-Id: I4f483efd13c099348f06094573c499858a8431ba
üst 3d07d18a
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include <dispatch/loaddispatcher.hxx> #include <dispatch/loaddispatcher.hxx>
#include <threadhelp/guard.hxx>
#include <com/sun/star/frame/DispatchResultState.hpp> #include <com/sun/star/frame/DispatchResultState.hpp>
...@@ -28,8 +27,7 @@ LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::uno::XComponentCo ...@@ -28,8 +27,7 @@ LoadDispatcher::LoadDispatcher(const css::uno::Reference< css::uno::XComponentCo
const css::uno::Reference< css::frame::XFrame >& xOwnerFrame , const css::uno::Reference< css::frame::XFrame >& xOwnerFrame ,
const OUString& sTargetName , const OUString& sTargetName ,
sal_Int32 nSearchFlags) sal_Int32 nSearchFlags)
: ThreadHelpBase( ) : m_xContext (xContext )
, m_xContext (xContext )
, m_xOwnerFrame (xOwnerFrame ) , m_xOwnerFrame (xOwnerFrame )
, m_sTarget (sTargetName ) , m_sTarget (sTargetName )
, m_nSearchFlags(nSearchFlags) , m_nSearchFlags(nSearchFlags)
...@@ -85,8 +83,7 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL, ...@@ -85,8 +83,7 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL,
// and clear our reference ...) we should hold us self alive! // and clear our reference ...) we should hold us self alive!
css::uno::Reference< css::uno::XInterface > xThis(static_cast< css::frame::XNotifyingDispatch* >(this), css::uno::UNO_QUERY); css::uno::Reference< css::uno::XInterface > xThis(static_cast< css::frame::XNotifyingDispatch* >(this), css::uno::UNO_QUERY);
// SAFE -> ---------------------------------- osl::MutexGuard g(m_mutex);
Guard aReadLock(m_aLock);
// We are the only client of this load env object ... but // We are the only client of this load env object ... but
// may a dispatch request before is still in progress (?!). // may a dispatch request before is still in progress (?!).
...@@ -151,8 +148,6 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL, ...@@ -151,8 +148,6 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL,
if ( xComponent.is () ) if ( xComponent.is () )
aRet = css::uno::makeAny( xComponent ); aRet = css::uno::makeAny( xComponent );
aReadLock.unlock();
// <- SAFE ----------------------------------
return aRet; return aRet;
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_LOADDISPATCHER_HXX #define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_LOADDISPATCHER_HXX
#include <loadenv/loadenv.hxx> #include <loadenv/loadenv.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <com/sun/star/frame/XNotifyingDispatch.hpp> #include <com/sun/star/frame/XNotifyingDispatch.hpp>
#include <com/sun/star/frame/XSynchronousDispatch.hpp> #include <com/sun/star/frame/XSynchronousDispatch.hpp>
...@@ -36,14 +35,14 @@ namespace framework{ ...@@ -36,14 +35,14 @@ namespace framework{
@author as96863 @author as96863
*/ */
class LoadDispatcher : private ThreadHelpBase class LoadDispatcher : public ::cppu::WeakImplHelper2< css::frame::XNotifyingDispatch, // => XDispatch => XInterface
, public ::cppu::WeakImplHelper2< css::frame::XNotifyingDispatch, // => XDispatch => XInterface
css::frame::XSynchronousDispatch > css::frame::XSynchronousDispatch >
{ {
// member // member
private: private:
osl::Mutex m_mutex;
/** @short can be used to create own needed services on demand. */ /** @short can be used to create own needed services on demand. */
css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::uno::XComponentContext > m_xContext;
......
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