summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
authorGopi Krishna Menon <gopi.menon@collabora.com>2021-07-29 15:21:13 +0530
committerTor Lillqvist <tml@collabora.com>2021-08-17 22:26:52 +0200
commit5c84de37ada9f5835bf0a644b0d5b7f7c7dedd2c (patch)
tree9d22124bc8c4d97d24a67835a84d4eb66d7c0574 /comphelper/source
parent2dffae230ce7d8e1556b7c746c3ae8b4b9360fad (diff)
Fix nesting level bug in ProfileZone
Move the profile zone global nesting variable into the source from header and make it thread-local. Change-Id: I97751f5c532d8e0e36adb7d9d383bd88f752953f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119657 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/misc/traceevent.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
index c379bbb97f7e..8b1a9c09427a 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -29,7 +29,8 @@ std::size_t TraceEvent::s_nBufferSize = 0;
void (*TraceEvent::s_pBufferFullCallback)() = nullptr;
int AsyncEvent::s_nIdCounter = 0;
-int ProfileZone::s_nNesting = 0;
+
+static thread_local int nProfileZoneNesting = 0; // Level of Nested Profile Zones
namespace
{
@@ -134,6 +135,10 @@ void ProfileZone::addRecording()
+ OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
}
+int ProfileZone::getNestingLevel() { return nProfileZoneNesting; }
+
+void ProfileZone::setNestingLevel(int nNestingLevel) { nProfileZoneNesting = nNestingLevel; }
+
} // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */