Dbg:Threading: use pthread_setname_np for debugging ease
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
#include <iostream>
|
||||
#include <pthread.h>
|
||||
#include <componentThread.h>
|
||||
#include <marionette/marionette.h>
|
||||
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -45,6 +45,7 @@ const std::shared_ptr<ComponentThread> ComponentThread::getSelf(void)
|
||||
|
||||
void MindThread::main(MindThread& self)
|
||||
{
|
||||
pthread_setname_np(pthread_self(), self.name.c_str());
|
||||
|
||||
if (OptionParser::getOptions().verbose)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user