summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@libreoffice.org>2021-07-18 10:11:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-18 11:37:21 +0200
commit3785f97ec18feba9c5508559e5aed6d25cfc3aed (patch)
treec43c0149911efecad16ea4ee8c62db35d5c21c68
parente0ba91b7e8a2f0d949677db1708bb0e6d8534389 (diff)
binaryurp : use std::mutex in outgoingrequests
Change-Id: Ib0670af4596c5a40da27138d62b78df69bb77b9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119121 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--binaryurp/source/outgoingrequests.cxx7
-rw-r--r--binaryurp/source/outgoingrequests.hxx5
2 files changed, 5 insertions, 7 deletions
diff --git a/binaryurp/source/outgoingrequests.cxx b/binaryurp/source/outgoingrequests.cxx
index 859aa8b9270d..ed15e5a1bda8 100644
--- a/binaryurp/source/outgoingrequests.cxx
+++ b/binaryurp/source/outgoingrequests.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <rtl/byteseq.hxx>
-#include <osl/mutex.hxx>
#include "lessoperators.hxx"
#include "outgoingrequest.hxx"
@@ -38,12 +37,12 @@ OutgoingRequests::~OutgoingRequests() {}
void OutgoingRequests::push(
rtl::ByteSequence const & tid, OutgoingRequest const & request)
{
- osl::MutexGuard g(mutex_);
+ std::lock_guard g(mutex_);
map_[tid].push_back(request);
}
OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
- osl::MutexGuard g(mutex_);
+ std::lock_guard g(mutex_);
Map::iterator i(map_.find(tid));
if (i == map_.end()) {
throw css::uno::RuntimeException(
@@ -54,7 +53,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
}
void OutgoingRequests::pop(rtl::ByteSequence const & tid) noexcept {
- osl::MutexGuard g(mutex_);
+ std::lock_guard g(mutex_);
Map::iterator i(map_.find(tid));
assert(i != map_.end());
i->second.pop_back();
diff --git a/binaryurp/source/outgoingrequests.hxx b/binaryurp/source/outgoingrequests.hxx
index 294119693d02..698b6db9e417 100644
--- a/binaryurp/source/outgoingrequests.hxx
+++ b/binaryurp/source/outgoingrequests.hxx
@@ -22,10 +22,9 @@
#include <sal/config.h>
#include <map>
+#include <mutex>
#include <vector>
-#include <osl/mutex.hxx>
-
namespace binaryurp
{
struct OutgoingRequest;
@@ -56,7 +55,7 @@ private:
typedef std::map<rtl::ByteSequence, std::vector<OutgoingRequest>> Map;
- osl::Mutex mutex_;
+ std::mutex mutex_;
Map map_;
};
}