swebb2066 commented on code in PR #130: URL: https://github.com/apache/logging-log4cxx/pull/130#discussion_r972549808
########## src/main/cpp/loggingevent.cpp: ########## @@ -297,40 +302,62 @@ LoggingEvent::KeySet LoggingEvent::getPropertyKeySet() const } -const LogString LoggingEvent::getCurrentThreadName() +const LogString& LoggingEvent::getCurrentThreadName() { -#if APR_HAS_THREADS - LOG4CXX_THREAD_LOCAL LogString thread_name; +#if defined(_WIN32) + using ThreadIdType = DWORD; + ThreadIdType threadId = GetCurrentThreadId(); +#elif APR_HAS_THREADS + using ThreadIdType = apr_os_thread_t; + ThreadIdType threadId = apr_os_thread_current(); +#else + using ThreadIdType = int; + ThreadIdType threadId = 0; +#endif - if ( thread_name.size() ) +#if defined(__BORLANDC__) Review Comment: For the record, the BORLANDC macro was introduced because the following page [BCC compliance status](http://docwiki.embarcadero.com/RADStudio/Sydney/en/Modern_C%2B%2B_Language_Features_Compliance_Status) states thread_local is (strangly) only supported by [BCCIOSARM64](https://docwiki.embarcadero.com/RADStudio/Sydney/en/BCCIOSARM64). Any idea why they would remove support for thread_local on some architectures? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org