diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index 648735757..b8e945c59 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -15,6 +15,7 @@ #include "PacketQueue.hpp" #include "helpers.hpp" #include "dvbsubtitle.h" +#include #define Log2File printf #define RECVBUFFER_STEPSIZE 1024 @@ -244,6 +245,7 @@ static void* reader_thread(void * /*arg*/) uint16_t packlen; uint8_t* buf; bool bad_startcode = false; + set_threadname("dvbsub:reader"); dmx = new cDemux(0); #if HAVE_TRIPLEDRAGON @@ -347,7 +349,7 @@ static void* dvbsub_thread(void* /*arg*/) { struct timespec restartWait; struct timeval now; - + set_threadname("dvbsub:main"); sub_debug.print(Debug::VERBOSE, "%s started\n", __FUNCTION__); if (!dvbSubtitleConverter) dvbSubtitleConverter = new cDvbSubtitleConverter; diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index b26e48e37..c6f5f4ce9 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -22,6 +22,7 @@ #include #include #include +#include /* same as in rcinput.h... */ #define KEY_TTTV KEY_FN_1 @@ -1545,6 +1546,7 @@ static void cleanup_fb_pan() static void* reader_thread(void * /*arg*/) { printf("TuxTxt subtitle thread started\n"); + set_threadname("tuxtxt:reader"); reader_running = 1; //ttx_paused = 0; while(reader_running) { diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index a7f1eede8..0abbf87c1 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -14,6 +14,7 @@ #endif #include +#include tuxtxt_cache_struct tuxtxt_cache; static pthread_mutex_t tuxtxt_cache_lock = PTHREAD_MUTEX_INITIALIZER; @@ -593,6 +594,7 @@ void *tuxtxt_CacheThread(void * /*arg*/) unsigned char pagedata[9][23*40]; tstPageinfo *pageinfo_thread; + set_threadname("tuxtxt:cache"); printf("TuxTxt running thread...(%04x)\n",tuxtxt_cache.vtxtpid); tuxtxt_cache.receiving = 1; nice(3); diff --git a/src/driver/audioplay.cpp b/src/driver/audioplay.cpp index 4359956ba..956319297 100644 --- a/src/driver/audioplay.cpp +++ b/src/driver/audioplay.cpp @@ -43,6 +43,7 @@ #include #include #include // UTF8 +#include void CAudioPlayer::stop() { @@ -88,6 +89,7 @@ CAudioPlayer* CAudioPlayer::getInstance() void* CAudioPlayer::PlayThread( void* /*dummy*/ ) { int soundfd = -1; + set_threadname("audio:play"); g_RCInput->close_click(); /* Decode stdin to stdout. */ CBaseDec::RetCode Status = diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 1b28ec365..982780144 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -47,6 +47,7 @@ #include #include +#include #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ @@ -154,6 +155,7 @@ void CLCD::wake_up() { #ifndef BOXMODEL_DM500 void* CLCD::TimeThread(void *p) { + set_threadname("lcd:time"); ((CLCD *)p)->thread_started = true; while (((CLCD *)p)->thread_started) { diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index 458e4dabf..9b9add628 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -108,6 +108,7 @@ #include #include #include +#include /* TODO: - ICECAST support @@ -1603,6 +1604,7 @@ void CacheFillThread(void *c) if(scache->closed) return; + set_threadname("netfile:cache"); dprintf(stderr, "CacheFillThread: thread started, using stream %p\n", scache->fd); buf = (char*)malloc(CACHEBTRANS); diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index 43d55f22c..e8e4ac9ce 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -37,6 +37,7 @@ #include #include #include +#include SHTDCNT::SHTDCNT() @@ -68,6 +69,7 @@ SHTDCNT* SHTDCNT::getInstance() void* SHTDCNT::TimeThread(void *) { + set_threadname("n:shtdcnt"); while(1) { sleep(1); diff --git a/src/driver/simple_display.cpp b/src/driver/simple_display.cpp index 1eeb1100e..df158909a 100644 --- a/src/driver/simple_display.cpp +++ b/src/driver/simple_display.cpp @@ -45,6 +45,8 @@ #define DISPLAY_DEV "/dev/null" #endif +#include + static char volume = 0; //static char percent = 0; static bool power = true; @@ -149,6 +151,7 @@ void CLCD::wake_up() void* CLCD::TimeThread(void *) { + set_threadname("n:boxdisplay"); /* to not confuse with TV display */ while (CLCD::getInstance()->thread_running) { sleep(1); CLCD::getInstance()->showTime(); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 962b950df..cd32f66be 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2110,6 +2110,7 @@ static void print_meminfo(void) static void *houseKeepingThread(void *) { int count = 0, scount = 0, ecount = 0; + set_threadname("sd:housekeeping"); dprintf("housekeeping-thread started.\n"); pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index cedebc332..9ca52c03c 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -775,6 +775,7 @@ bool CCDraw::paintBlink(const int& interval, bool is_nano) { if (cc_draw_timer == NULL) cc_draw_timer = new CComponentsTimer(interval, is_nano); + cc_draw_timer->setThreadName(__func__); return paintBlink(cc_draw_timer); } diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 531c1af89..0f4329ea3 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -321,6 +321,7 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(0); + cl_timer->setThreadName("frmClock"); if (cl_timer->OnTimer.empty()){ dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); cl_timer->OnTimer.connect(cl_sl_show); diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 4b61201ce..45ef2b6ed 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -188,8 +188,10 @@ void CHintBox::enableTimeOutBar(bool enable) timeout_pb = new CProgressBar(); timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); timeout_pb->setValues(0, 100*timeout); - if (!timeout_pb_timer) + if (!timeout_pb_timer) { timeout_pb_timer = new CComponentsTimer(1, true); + timeout_pb_timer->setThreadName("hb:tmoutbar"); + } timeout_pb_timer->OnTimer.connect(sigc::mem_fun0(this, &CHintBox::showTimeOutBar)); timeout_pb_timer->startTimer(); } @@ -200,7 +202,6 @@ int CHintBox::exec() neutrino_msg_t msg; neutrino_msg_data_t data; int res = messages_return::none; - if (timeout == NO_TIMEOUT || timeout == DEFAULT_TIMEOUT) timeout = HINTBOX_DEFAULT_TIMEOUT; diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index 0a8b4d77a..e1a5f149d 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -118,7 +118,7 @@ CWebserver::~CWebserver() { #define MAX_TIMEOUTS_TO_CLOSE 10 #define MAX_TIMEOUTS_TO_TEST 100 bool CWebserver::run(void) { - set_threadname(__func__); + set_threadname("ywebsrv::run"); if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) { if (port != 80) { fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port); diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index f113f3dba..7b98bfd43 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #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; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index fec447b79..8998ea2d2 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -42,7 +42,7 @@ #include "debug.h" #include "timermanager.h" - +#include 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;