mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
Always set thread names on POSIX platforms (#3384)
* chore: gitignore vim .swp files * feat(POSIX): Always set thread names. 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.
This commit is contained in:
parent
674446d44d
commit
0af9524e16
7
.gitignore
vendored
7
.gitignore
vendored
@ -144,3 +144,10 @@ cmake-build/
|
||||
*.bak
|
||||
stage/
|
||||
releases/
|
||||
|
||||
# vim #
|
||||
#######
|
||||
*.orig
|
||||
*.swp
|
||||
*.vim
|
||||
tags
|
||||
|
@ -62,9 +62,6 @@ namespace
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(POCO_POSIX_DEBUGGER_THREAD_NAMES)
|
||||
|
||||
|
||||
namespace {
|
||||
void setThreadName(pthread_t thread, const std::string& threadName)
|
||||
{
|
||||
@ -83,9 +80,6 @@ void setThreadName(pthread_t thread, const std::string& threadName)
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user