set useful thread names for all spawned threads

This commit is contained in:
Stefan Seyfried
2017-02-12 15:17:32 +01:00
committed by svenhoefer
parent 6fdd920e42
commit 5188f721c4
14 changed files with 26 additions and 6 deletions

View File

@@ -33,6 +33,7 @@
#include <sectionsdclient/sectionsdclient.h>
#include <connection/basicserver.h>
#include <timerdclient/timerdmsg.h>
#include <system/set_threadname.h>
#include "debug.h"
#include "timermanager.h"
@@ -480,7 +481,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd)
int timerd_main_thread(void *data)
{
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
set_threadname("n:timerd");
printf("timerd startup, tid %ld\n", syscall(__NR_gettid));
CBasicServer timerd_server;

View File

@@ -42,7 +42,7 @@
#include "debug.h"
#include "timermanager.h"
#include <system/set_threadname.h>
extern bool timeset;
time_t timer_minutes;
@@ -89,6 +89,7 @@ void* CTimerManager::timerThread(void *arg)
pthread_mutex_t dummy_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t dummy_cond = PTHREAD_COND_INITIALIZER;
struct timespec wait;
set_threadname("n:timermanager");
CTimerManager *timerManager = (CTimerManager*) arg;