diff options
author | Gopi Krishna Menon <gopi.menon@collabora.com> | 2021-07-29 15:21:13 +0530 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-07-30 13:07:49 +0200 |
commit | 74f4a1796f94477d459c71d0a0aaa8f4a430e208 (patch) | |
tree | 39f455a517a6ea52a7c0f9daf36b3ee1bcf72904 /comphelper | |
parent | 172f589471edcac9a4974132a3145b721942879a (diff) |
Fix Nesting Level Bug in ProfileZone
Moves the profile zone global nesting variable into the source from header and makes it threadlocal
Change-Id: I97751f5c532d8e0e36adb7d9d383bd88f752953f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119662
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/traceevent.cxx | 7 |
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: */ |