This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
The following commit(s) were added to refs/heads/master by this push:
new 8afbcd0d Prevent SonarCloud source code analysis warning (#621)
8afbcd0d is described below
commit 8afbcd0dcbe4ddfbc3e6d53c53e13cd446d00b37
Author: Stephen Webb <[email protected]>
AuthorDate: Sat Apr 4 12:22:06 2026 +1100
Prevent SonarCloud source code analysis warning (#621)
---
src/main/cpp/threadspecificdata.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/cpp/threadspecificdata.cpp
b/src/main/cpp/threadspecificdata.cpp
index b4ad482b..5f2f4e29 100644
--- a/src/main/cpp/threadspecificdata.cpp
+++ b/src/main/cpp/threadspecificdata.cpp
@@ -266,6 +266,7 @@ ThreadSpecificData* ThreadSpecificData::getCurrentData()
return (ThreadSpecificData*) pData;
#endif
+#if !LOG4CXX_HAS_THREAD_LOCAL
// Fallback implementation that is not expected to be used
using TaggedData = std::pair<std::thread::id, ThreadSpecificData>;
static std::list<TaggedData> thread_id_map;
@@ -277,6 +278,7 @@ ThreadSpecificData* ThreadSpecificData::getCurrentData()
if (thread_id_map.end() == pThreadId)
pThreadId = thread_id_map.emplace(thread_id_map.begin(),
threadId, ThreadSpecificData());
return &pThreadId->second;
+#endif
}
void ThreadSpecificData::recycle()