diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-05-08 19:48:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-09 10:17:38 +0200 |
commit | 7537c81fd6a141a6e04b0de00608f147ca9ea7dc (patch) | |
tree | 404368549291d9945f543fcd325af0dd3a0ba44c /desktop | |
parent | 9277faf14a713b8ae88596785874bdcdfc47957c (diff) |
osl::Mutex->std::mutex in desktop::Acceptor
Change-Id: I450734e615c4c214f18641a3ac79f6810d98922c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134030
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/offacc/acceptor.cxx | 8 | ||||
-rw-r--r-- | desktop/source/offacc/acceptor.hxx | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 8c6cdbff0461..66afe6c18bb4 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -63,7 +63,7 @@ Acceptor::~Acceptor() m_rAcceptor->stopAccepting(); oslThread t; { - osl::MutexGuard g(m_aMutex); + std::unique_lock g(m_aMutex); t = m_thread; } //prevent locking if the thread is still waiting @@ -75,7 +75,7 @@ Acceptor::~Acceptor() // Make the final state of m_bridges visible to this thread (since // m_thread is joined, the code that follows is the only one left // accessing m_bridges): - osl::MutexGuard g(m_aMutex); + std::unique_lock g(m_aMutex); } for (;;) { css::uno::Reference< css::bridge::XBridge > b(m_bridges.remove()); @@ -118,7 +118,7 @@ void Acceptor::run() // the bridge, it will be destructed. Reference< XBridge > rBridge = m_rBridgeFactory->createBridge( "", m_aProtocol, rConnection, rInstanceProvider); - osl::MutexGuard g(m_aMutex); + std::unique_lock g(m_aMutex); m_bridges.add(rBridge); } catch (const Exception&) { TOOLS_WARN_EXCEPTION("desktop.offacc", ""); @@ -133,7 +133,7 @@ void Acceptor::run() void Acceptor::initialize( const Sequence<Any>& aArguments ) { // prevent multiple initialization - osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); SAL_INFO( "desktop.offacc", "Acceptor::initialize()" ); bool bOk = false; diff --git a/desktop/source/offacc/acceptor.hxx b/desktop/source/offacc/acceptor.hxx index 36b3e181cc93..9e210459a544 100644 --- a/desktop/source/offacc/acceptor.hxx +++ b/desktop/source/offacc/acceptor.hxx @@ -30,10 +30,11 @@ #include <cppuhelper/implbase.hxx> #include <comphelper/weakbag.hxx> -#include <osl/mutex.hxx> #include <osl/conditn.hxx> #include <osl/thread.hxx> +#include <mutex> + namespace com::sun::star::uno { class XComponentContext; } namespace desktop { @@ -42,7 +43,7 @@ class Acceptor : public ::cppu::WeakImplHelper<css::lang::XServiceInfo, css::lang::XInitialization> { private: - osl::Mutex m_aMutex; + std::mutex m_aMutex; oslThread m_thread; comphelper::WeakBag< css::bridge::XBridge > m_bridges; |