diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-18 13:02:04 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-18 13:29:14 +0100 |
commit | 9ed5d36981d03e4f91c1f34eabeb494e68a2b76a (patch) | |
tree | 58b7ef4abd94073643950c5f79911619c3437c11 /stoc | |
parent | db9d30a8ee01d5a737a769251eed784929875af1 (diff) |
Use cppu::BaseMutex instead of plain osl::Mutex as base
Change-Id: Ib4fa4669adb217be810840b3f8e4f0e2dda0f7c5
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 24 | ||||
-rw-r--r-- | stoc/source/javavm/javavm.hxx | 7 |
2 files changed, 16 insertions, 15 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 1f70464ab79b..1418b9b73ace 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -575,7 +575,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL javavm_component_getFactory(sal_ JavaVirtualMachine::JavaVirtualMachine( css::uno::Reference< css::uno::XComponentContext > const & rContext): - JavaVirtualMachine_Impl(*static_cast< osl::Mutex * >(this)), + JavaVirtualMachine_Impl(m_aMutex), m_xContext(rContext), m_bDisposed(false), m_pJavaVm(0), @@ -588,7 +588,7 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & rArguments) throw (css::uno::Exception, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -681,7 +681,7 @@ css::uno::Any SAL_CALL JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) throw (css::uno::RuntimeException, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -930,7 +930,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) sal_Bool SAL_CALL JavaVirtualMachine::isVMStarted() throw (css::uno::RuntimeException, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -941,7 +941,7 @@ sal_Bool SAL_CALL JavaVirtualMachine::isVMEnabled() throw (css::uno::RuntimeException, std::exception) { { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -959,7 +959,7 @@ sal_Bool SAL_CALL JavaVirtualMachine::isVMEnabled() sal_Bool SAL_CALL JavaVirtualMachine::isThreadAttached() throw (css::uno::RuntimeException, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -973,7 +973,7 @@ sal_Bool SAL_CALL JavaVirtualMachine::isThreadAttached() void SAL_CALL JavaVirtualMachine::registerThread() throw (css::uno::RuntimeException, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -1006,7 +1006,7 @@ void SAL_CALL JavaVirtualMachine::registerThread() void SAL_CALL JavaVirtualMachine::revokeThread() throw (css::uno::RuntimeException, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_bDisposed) throw css::lang::DisposedException( OUString(), static_cast< cppu::OWeakObject * >(this)); @@ -1028,7 +1028,7 @@ void SAL_CALL JavaVirtualMachine::disposing(css::lang::EventObject const & rSource) throw (css::uno::RuntimeException, std::exception) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (rSource.Source == m_xInetConfiguration) m_xInetConfiguration.clear(); if (rSource.Source == m_xJavaConfiguration) @@ -1156,7 +1156,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( rtl::Reference< jvmaccess::VirtualMachine > xVirtualMachine; { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); if (m_xUnoVirtualMachine.is()) { xVirtualMachine = m_xUnoVirtualMachine->getVirtualMachine(); } @@ -1310,7 +1310,7 @@ void SAL_CALL JavaVirtualMachine::disposing() css::uno::Reference< css::container::XContainer > xContainer1; css::uno::Reference< css::container::XContainer > xContainer2; { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); m_bDisposed = true; xContainer1 = m_xInetConfiguration; m_xInetConfiguration.clear(); @@ -1404,7 +1404,7 @@ void JavaVirtualMachine::registerConfigChangesListener() // false: the Java net properties are set to empty value. void JavaVirtualMachine::setINetSettingsInVM(bool set_reset) { - osl::MutexGuard aGuard(*this); + osl::MutexGuard aGuard(m_aMutex); try { if (m_xUnoVirtualMachine.is()) diff --git a/stoc/source/javavm/javavm.hxx b/stoc/source/javavm/javavm.hxx index adcfe1cc4aac..d5bff2400b1d 100644 --- a/stoc/source/javavm/javavm.hxx +++ b/stoc/source/javavm/javavm.hxx @@ -28,10 +28,10 @@ #include "com/sun/star/java/XJavaVM.hpp" #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/uno/Reference.hxx" +#include "cppuhelper/basemutex.hxx" #include "cppuhelper/compbase5.hxx" #include "osl/thread.hxx" #include "rtl/ref.hxx" -#include <osl/mutex.hxx> #include <rtl/ustring.hxx> namespace com { namespace sun { namespace star { @@ -57,7 +57,8 @@ cppu::WeakComponentImplHelper5< com::sun::star::lang::XInitialization, com::sun::star::container::XContainerListener > JavaVirtualMachine_Impl; -class JavaVirtualMachine: private osl::Mutex, public JavaVirtualMachine_Impl +class JavaVirtualMachine: + private cppu::BaseMutex, public JavaVirtualMachine_Impl { public: explicit JavaVirtualMachine( @@ -141,7 +142,7 @@ private: com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; - // the following are controlled by the 'this' mutex: + // the following are controlled by BaseMutex::m_aMutex: bool m_bDisposed; rtl::Reference< jvmaccess::VirtualMachine > m_xVirtualMachine; rtl::Reference< jvmaccess::UnoVirtualMachine > m_xUnoVirtualMachine; |