From f146cb69eb2a2cc0bffb0e76dbccbcdf942d5f7e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 31 Jul 2021 18:31:25 +0200 Subject: osl::Mutex->std::mutex in Entity Change-Id: Ia9201dc4998a592ef4adaa39666f67a0935e8161 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119745 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sax/source/fastparser/fastparser.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sax') diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index aa3bb66c18f8..980c092c796e 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -173,7 +174,7 @@ struct Entity : public ParserData // resource leaks), therefore any exception thrown by a UNO callback // must be saved somewhere until the C-XmlParser is stopped. css::uno::Any maSavedException; - osl::Mutex maSavedExceptionMutex; + std::mutex maSavedExceptionMutex; void saveException( const Any & e ); // Thread-safe check if maSavedException has value bool hasException(); @@ -600,7 +601,7 @@ void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumen // Error during parsing ! Any savedException; { - osl::MutexGuard g(maSavedExceptionMutex); + std::lock_guard g(maSavedExceptionMutex); if (maSavedException.hasValue()) { savedException.setValue(&maSavedException, cppu::UnoType::get()); @@ -642,7 +643,7 @@ void Entity::saveException( const Any & e ) // unexpectedly some 'startElements' produce a UNO_QUERY_THROW // for XComponent; and yet expect to continue parsing. SAL_WARN("sax", "Unexpected exception from XML parser " << exceptionToString(e)); - osl::MutexGuard g(maSavedExceptionMutex); + std::lock_guard g(maSavedExceptionMutex); if (maSavedException.hasValue()) { SAL_INFO("sax.fastparser", "discarding exception, already have one"); @@ -655,7 +656,7 @@ void Entity::saveException( const Any & e ) bool Entity::hasException() { - osl::MutexGuard g(maSavedExceptionMutex); + std::lock_guard g(maSavedExceptionMutex); return maSavedException.hasValue(); } -- cgit