mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 10:21:04 +02:00
CComponentsTimer: allow to set a thread name
Origin commit data
------------------
Commit: 6fdd920e42
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-12 (Sun, 12 Feb 2017)
This commit is contained in:
committed by
vanhofen
parent
30fd1a003c
commit
10f50617ba
@@ -33,11 +33,13 @@
|
||||
#include <errno.h>
|
||||
#include <system/helpers.h>
|
||||
#include <system/debug.h>
|
||||
#include <system/set_threadname.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
CComponentsTimer::CComponentsTimer(const int& interval, bool is_nano)
|
||||
{
|
||||
name = "unnamed";
|
||||
tm_thread = 0;
|
||||
tm_interval = interval;
|
||||
tm_enable_nano = is_nano;
|
||||
@@ -56,7 +58,8 @@ CComponentsTimer::~CComponentsTimer()
|
||||
void CComponentsTimer::runSharedTimerAction()
|
||||
{
|
||||
//start loop
|
||||
|
||||
string tn = "cc:"+name;
|
||||
set_threadname(tn.c_str());
|
||||
while(tm_enable && tm_interval > 0) {
|
||||
tm_mutex.lock();
|
||||
OnTimer();
|
||||
|
Reference in New Issue
Block a user