summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorArnaud VERSINI <arnaud.versini@libreoffice.org>2022-01-30 10:30:27 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-24 15:28:46 +0100
commitc2424341ed444647d979a69ae55268e96fad3d56 (patch)
tree5682c1ba39df597ea943a0305ca8c3bd7cd5c6cf /comphelper
parent3b30ea9c00598b9de85333b67e8b3339d414eec3 (diff)
comphelper : use std::mutex in traceevent
Change-Id: I959b8c189a9ad073167cf3e0620947cbda77196c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129159 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/traceevent.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
index ab71853e1292..fb07e1caa771 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -10,6 +10,7 @@
#include <sal/config.h>
#include <atomic>
+#include <mutex>
#include <iostream>
#include <comphelper/profilezone.hxx>
@@ -34,12 +35,12 @@ static thread_local int nProfileZoneNesting = 0; // Level of Nested Profile Zone
namespace
{
std::vector<OUString> g_aRecording; // recorded data
-osl::Mutex g_aMutex;
+std::mutex g_aMutex;
}
void TraceEvent::addRecording(const OUString& sObject)
{
- osl::MutexGuard aGuard(g_aMutex);
+ std::lock_guard aGuard(g_aMutex);
g_aRecording.emplace_back(sObject);
@@ -76,7 +77,7 @@ void TraceEvent::addInstantEvent(const char* sName, const std::map<OUString, OUS
void TraceEvent::startRecording()
{
- osl::MutexGuard aGuard(g_aMutex);
+ std::lock_guard aGuard(g_aMutex);
s_bRecording = true;
}
@@ -93,7 +94,7 @@ std::vector<OUString> TraceEvent::getEventVectorAndClear()
bool bRecording;
std::vector<OUString> aRecording;
{
- osl::MutexGuard aGuard(g_aMutex);
+ std::lock_guard aGuard(g_aMutex);
bRecording = s_bRecording;
stopRecording();
aRecording.swap(g_aRecording);