Use an osl::Mutex directly
Change-Id: I4adad36de95c022a7945b61a44bb6166ad87a8a7
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
||||||
#define INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
#define INCLUDED_FRAMEWORK_INC_DISPATCH_OXT_HANDLER_HXX
|
||||||
|
|
||||||
#include <threadhelp/threadhelpbase.hxx>
|
|
||||||
#include <macros/xinterface.hxx>
|
#include <macros/xinterface.hxx>
|
||||||
#include <macros/xtypeprovider.hxx>
|
#include <macros/xtypeprovider.hxx>
|
||||||
#include <macros/xserviceinfo.hxx>
|
#include <macros/xserviceinfo.hxx>
|
||||||
@@ -53,11 +52,7 @@ namespace framework{
|
|||||||
@devstatus ready
|
@devstatus ready
|
||||||
@threadsafe yes
|
@threadsafe yes
|
||||||
*//*-*************************************************************************************************************/
|
*//*-*************************************************************************************************************/
|
||||||
class Oxt_Handler : // baseclasses
|
class Oxt_Handler : public ::cppu::WeakImplHelper3<
|
||||||
// Order is necessary for right initialization!
|
|
||||||
private ThreadHelpBase
|
|
||||||
// interfaces
|
|
||||||
, public ::cppu::WeakImplHelper3<
|
|
||||||
css::lang::XServiceInfo,
|
css::lang::XServiceInfo,
|
||||||
css::frame::XNotifyingDispatch, // => XDispatch
|
css::frame::XNotifyingDispatch, // => XDispatch
|
||||||
css::document::XExtendedFilterDetection >
|
css::document::XExtendedFilterDetection >
|
||||||
@@ -114,6 +109,7 @@ class Oxt_Handler : // baseclasses
|
|||||||
// (should be private everyway!)
|
// (should be private everyway!)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
osl::Mutex m_mutex;
|
||||||
|
|
||||||
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// global uno service factory to create new services
|
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory ; /// global uno service factory to create new services
|
||||||
css::uno::Reference< css::uno::XInterface > m_xSelfHold ; /// we must protect us against dieing during async(!) dispatch() call!
|
css::uno::Reference< css::uno::XInterface > m_xSelfHold ; /// we must protect us against dieing during async(!) dispatch() call!
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dispatch/oxt_handler.hxx>
|
#include <dispatch/oxt_handler.hxx>
|
||||||
#include <threadhelp/guard.hxx>
|
|
||||||
#include <threadhelp/transactionguard.hxx>
|
#include <threadhelp/transactionguard.hxx>
|
||||||
#include <services.h>
|
#include <services.h>
|
||||||
#include <unotools/mediadescriptor.hxx>
|
#include <unotools/mediadescriptor.hxx>
|
||||||
@@ -60,10 +59,7 @@ DEFINE_INIT_SERVICE ( Oxt_Handler,
|
|||||||
@threadsafe yes
|
@threadsafe yes
|
||||||
*//*-*************************************************************************************************************/
|
*//*-*************************************************************************************************************/
|
||||||
Oxt_Handler::Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory )
|
Oxt_Handler::Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory )
|
||||||
// Init baseclasses first
|
: m_xFactory ( xFactory )
|
||||||
: ThreadHelpBase ( )
|
|
||||||
// Init member
|
|
||||||
, m_xFactory ( xFactory )
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,8 +113,7 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL,
|
|||||||
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
|
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
|
||||||
throw( css::uno::RuntimeException, std::exception )
|
throw( css::uno::RuntimeException, std::exception )
|
||||||
{
|
{
|
||||||
// SAFE {
|
osl::MutexGuard g(m_mutex);
|
||||||
Guard aLock( m_aLock );
|
|
||||||
|
|
||||||
OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog";
|
OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog";
|
||||||
css::uno::Sequence< css::uno::Any > lParams(1);
|
css::uno::Sequence< css::uno::Any > lParams(1);
|
||||||
@@ -137,9 +132,6 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL,
|
|||||||
aEvent.State = css::frame::DispatchResultState::SUCCESS;
|
aEvent.State = css::frame::DispatchResultState::SUCCESS;
|
||||||
xListener->dispatchFinished( aEvent );
|
xListener->dispatchFinished( aEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
// } SAFE
|
|
||||||
aLock.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL Oxt_Handler::dispatch( const css::util::URL& aURL ,
|
void SAL_CALL Oxt_Handler::dispatch( const css::util::URL& aURL ,
|
||||||
|
Reference in New Issue
Block a user