summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-31 18:31:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-31 20:13:09 +0200
commitf146cb69eb2a2cc0bffb0e76dbccbcdf942d5f7e (patch)
tree3980fcbb27063010529939fde383b5a8119784eb /sax
parent299b72e4c9ad239d747e47eaf004400f5a590695 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/fastparser/fastparser.cxx9
1 files changed, 5 insertions, 4 deletions
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 <queue>
#include <memory>
+#include <mutex>
#include <stack>
#include <string_view>
#include <unordered_map>
@@ -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<decltype(maSavedException)>::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();
}