This is an automated email from the ASF dual-hosted git repository. swebb2066 pushed a commit to branch next_stable in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 3e3d042f43d70be1f845640b6c1dfe906e9c7127 Merge: ef0feede a7bb076c Author: Stephen Webb <[email protected]> AuthorDate: Wed Nov 2 08:41:03 2022 +1100 Merge branch 'master' into next_stable .asf.yaml | 2 + .asf.yaml => .github/workflows/log4cxx-cpp11.yml | 41 ++++++-- .github/workflows/log4cxx-posix.yml | 86 ++++++++++++++++ .github/workflows/log4cxx-windows-static.yml | 87 +++++++++++++++++ .github/workflows/log4cxx-windows.yml | 86 ++++++++++++++++ .github/workflows/log4cxx.yml | 119 ----------------------- CMakeLists.txt | 2 + src/examples/cpp/CMakeLists.txt | 2 +- src/main/cpp/logstream.cpp | 5 + src/main/cpp/messagebuffer.cpp | 5 + src/main/cpp/ndc.cpp | 4 +- src/main/cpp/threadutility.cpp | 15 ++- src/main/cpp/transcoder.cpp | 4 +- src/main/include/CMakeLists.txt | 9 ++ src/test/cpp/pattern/patternparsertestcase.cpp | 6 +- src/test/cpp/rolling/manualrollingtest.cpp | 7 +- src/test/cpp/rolling/timebasedrollingtest.cpp | 37 ++++--- src/test/cpp/streamtestcase.cpp | 12 ++- 18 files changed, 357 insertions(+), 172 deletions(-) diff --cc src/main/cpp/threadutility.cpp index 543281df,057ecd86..c311bba6 --- a/src/main/cpp/threadutility.cpp +++ b/src/main/cpp/threadutility.cpp @@@ -131,24 -113,19 +131,21 @@@ void ThreadUtility::preThreadBlockSigna } void ThreadUtility::threadStartedNameThread(LogString threadName, - std::thread::id /*threadId*/, - std::thread::native_handle_type nativeHandle){ + std::thread::id /*threadId*/, + std::thread::native_handle_type nativeHandle) +{ #if LOG4CXX_HAS_PTHREAD_SETNAME - - if ( pthread_setname_np( static_cast<pthread_t>( nativeHandle ), threadName.c_str() ) < 0 ) - { - LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); + LOG4CXX_ENCODE_CHAR(sthreadName, threadName); + if (pthread_setname_np(static_cast<pthread_t>(nativeHandle), sthreadName.c_str()) < 0) { + LOGLOG_ERROR(LOG4CXX_STR("unable to set thread name")); } -#elif LOG4CXX_HAS_SETTHREADDESCRIPTION + - #elif LOG4CXX_HAS_SETTHREADDESCRIPTION - HRESULT hr = SetThreadDescription(static_cast<HANDLE>(nativeHandle), threadName.c_str()); - - if (FAILED(hr)) - { + LOG4CXX_ENCODE_WCHAR(wthreadName, threadName); + HRESULT hr = SetThreadDescription(static_cast<HANDLE>(nativeHandle), wthreadName.c_str()); + if(FAILED(hr)){ LOGLOG_ERROR( LOG4CXX_STR("unable to set thread name") ); } + #endif }
