comphelper/source/misc/traceevent.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit c2424341ed444647d979a69ae55268e96fad3d56 Author: Arnaud VERSINI <arnaud.vers...@libreoffice.org> AuthorDate: Sun Jan 30 10:30:27 2022 +0100 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Mar 24 15:28:46 2022 +0100 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.gran...@collabora.co.uk> 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);