diff --git a/main.cpp b/main.cpp index 4c9808b..97da653 100644 --- a/main.cpp +++ b/main.cpp @@ -1,10 +1,12 @@ #include +#include #include #include int main(int argc, char *argv[], char *envp[]) { + pthread_setname_np(pthread_self(), "CRT:main"); /* We don't do anything inside of main() * Main merely waits for the marionette thread to exit. */ diff --git a/smocore/componentThread.cpp b/smocore/componentThread.cpp index 3b6ac1a..bd3d6b3 100644 --- a/smocore/componentThread.cpp +++ b/smocore/componentThread.cpp @@ -45,6 +45,7 @@ const std::shared_ptr ComponentThread::getSelf(void) void MindThread::main(MindThread& self) { + pthread_setname_np(pthread_self(), self.name.c_str()); if (OptionParser::getOptions().verbose) { diff --git a/smocore/marionette/main.cpp b/smocore/marionette/main.cpp index d9002eb..ecaa1b4 100644 --- a/smocore/marionette/main.cpp +++ b/smocore/marionette/main.cpp @@ -66,6 +66,7 @@ void marionetteInitializeReqCb(bool success) void MarionetteThread::main(MarionetteThread& self) { + pthread_setname_np(pthread_self(), self.name.c_str()); // Wait for CRT's main() to post us the command line args. std::cout << __func__ << ": Waiting for command line JOLT" << std::endl; self.getIoService().run();