Skip to content

Commit

Permalink
feat(POSIX): Always set thread names.
Browse files Browse the repository at this point in the history
I'm not sure about the original intent to hide it under a DEBUG macro.

Naming the threads in release mode makes it easier to see runtime
application and know which thread pool uses how many threads and what
their names are. Firefox, Chromium and many other apps do this on Linux.
  • Loading branch information
carun authored and Arun committed Jul 7, 2022
1 parent 96902f2 commit d13fe77
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Foundation/src/Thread_POSIX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ namespace
#endif


#if defined(POCO_POSIX_DEBUGGER_THREAD_NAMES)


namespace {
void setThreadName(pthread_t thread, const std::string& threadName)
{
Expand All @@ -83,9 +80,6 @@ void setThreadName(pthread_t thread, const std::string& threadName)
}


#endif


namespace Poco {


Expand Down Expand Up @@ -357,9 +351,7 @@ void* ThreadImpl::runnableEntry(void* pThread)
#endif

ThreadImpl* pThreadImpl = reinterpret_cast<ThreadImpl*>(pThread);
#if defined(POCO_POSIX_DEBUGGER_THREAD_NAMES)
setThreadName(pThreadImpl->_pData->thread, reinterpret_cast<Thread*>(pThread)->getName());
#endif
AutoPtr<ThreadData> pData = pThreadImpl->_pData;
try
{
Expand Down

0 comments on commit d13fe77

Please sign in to comment.