Skip to content
Snippets Groups Projects
Commit 17884e04 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

limit pthread names to 15 characters, make thread names shorter

parent 93814826
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,7 @@ namespace ChimeraTK { ...@@ -137,7 +137,7 @@ namespace ChimeraTK {
static void registerThread(const std::string &name) { static void registerThread(const std::string &name) {
threadName() = name; threadName() = name;
Profiler::registerThread(name); Profiler::registerThread(name);
pthread_setname_np(pthread_self(), name.c_str()); pthread_setname_np(pthread_self(), name.substr(0,std::min(name.length(),15UL)).c_str());
} }
ModuleType getModuleType() const override { return ModuleType::ModuleGroup; } ModuleType getModuleType() const override { return ModuleType::ModuleGroup; }
......
...@@ -48,7 +48,7 @@ namespace ChimeraTK { ...@@ -48,7 +48,7 @@ namespace ChimeraTK {
/** Synchronise feeder and the consumers. This function is executed in the separate thread. */ /** Synchronise feeder and the consumers. This function is executed in the separate thread. */
void run() { void run() {
Application::registerThread("ThreadedFanOut "+FanOut<UserType>::impl->getName()); Application::registerThread("ThFO"+FanOut<UserType>::impl->getName());
Application::testableModeLock("start"); Application::testableModeLock("start");
while(true) { while(true) {
// receive data // receive data
......
...@@ -61,7 +61,7 @@ namespace ChimeraTK { ...@@ -61,7 +61,7 @@ namespace ChimeraTK {
/** Synchronise feeder and the consumers. This function is executed in the separate thread. */ /** Synchronise feeder and the consumers. This function is executed in the separate thread. */
void run() { void run() {
Application::registerThread("TriggerFanOut "+externalTrigger->getName()); Application::registerThread("TrFO"+externalTrigger->getName());
Application::testableModeLock("start"); Application::testableModeLock("start");
while(true) { while(true) {
// wait for external trigger // wait for external trigger
......
...@@ -61,7 +61,7 @@ namespace ChimeraTK { ...@@ -61,7 +61,7 @@ namespace ChimeraTK {
/*********************************************************************************************************************/ /*********************************************************************************************************************/
void ApplicationModule::mainLoopWrapper() { void ApplicationModule::mainLoopWrapper() {
Application::registerThread("ApplicationModule "+getName()); Application::registerThread("AM_"+getName());
Application::testableModeLock("start"); Application::testableModeLock("start");
// enter the main loop // enter the main loop
mainLoop(); mainLoop();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment