mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
timerd.cpp: Fix thread declarations, typos, and improve timerd_main_thread consistency
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7571071f60
Author: GetAway <get-away@t-online.de>
Date: 2024-11-16 (Sat, 16 Nov 2024)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -189,10 +189,9 @@ t_channel_id standby_channel_id = 0;
|
|||||||
|
|
||||||
//NEW
|
//NEW
|
||||||
static pthread_t timer_thread;
|
static pthread_t timer_thread;
|
||||||
void * timerd_main_thread(void *data);
|
|
||||||
static bool timerd_thread_started = false;
|
static bool timerd_thread_started = false;
|
||||||
|
extern void *timerd_main_thread(void *data);
|
||||||
void * nhttpd_main_thread(void *data);
|
extern void *nhttpd_main_thread(void *data);
|
||||||
|
|
||||||
//#define DISABLE_SECTIONSD
|
//#define DISABLE_SECTIONSD
|
||||||
|
|
||||||
@@ -3143,8 +3142,9 @@ TIMER_START();
|
|||||||
|
|
||||||
/* wait until timerd is ready... */
|
/* wait until timerd is ready... */
|
||||||
int64_t timerd_wait = time_monotonic_ms();
|
int64_t timerd_wait = time_monotonic_ms();
|
||||||
while (timerd_signal >= 0)
|
while (timerd_signal >= 0) {
|
||||||
usleep(100);
|
usleep(100);
|
||||||
|
}
|
||||||
dprintf(DEBUG_NORMAL, "had to wait %" PRId64 " ms for timerd start...\n", time_monotonic_ms() - timerd_wait);
|
dprintf(DEBUG_NORMAL, "had to wait %" PRId64 " ms for timerd start...\n", time_monotonic_ms() - timerd_wait);
|
||||||
InitTimerdClient();
|
InitTimerdClient();
|
||||||
|
|
||||||
|
@@ -260,7 +260,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CTimerdMsg::CMD_ADDTIMER: // neuen timer hinzuf<EFBFBD>gen
|
case CTimerdMsg::CMD_ADDTIMER: // neuen timer hinzufuegen
|
||||||
CTimerdMsg::commandAddTimer msgAddTimer;
|
CTimerdMsg::commandAddTimer msgAddTimer;
|
||||||
CBasicServer::receive_data(connfd,&msgAddTimer, sizeof(msgAddTimer));
|
CBasicServer::receive_data(connfd,&msgAddTimer, sizeof(msgAddTimer));
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
CTimerManager::getInstance()->stopEvent(msgStopTimer.eventID);
|
CTimerManager::getInstance()->stopEvent(msgStopTimer.eventID);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CTimerdMsg::CMD_TIMERDAVAILABLE: // testen ob server l<EFBFBD>uft ;)
|
case CTimerdMsg::CMD_TIMERDAVAILABLE: // testen ob server laeuft ;)
|
||||||
{
|
{
|
||||||
CTimerdMsg::responseAvailable rspAvailable;
|
CTimerdMsg::responseAvailable rspAvailable;
|
||||||
rspAvailable.available = true;
|
rspAvailable.available = true;
|
||||||
@@ -481,7 +481,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int timerd_main_thread(void *data)
|
void *timerd_main_thread(void *data)
|
||||||
{
|
{
|
||||||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||||
set_threadname("n:timerd");
|
set_threadname("n:timerd");
|
||||||
@@ -491,7 +491,8 @@ int timerd_main_thread(void *data)
|
|||||||
|
|
||||||
if (!timerd_server.prepare(TIMERD_UDS_NAME)) {
|
if (!timerd_server.prepare(TIMERD_UDS_NAME)) {
|
||||||
*(long *)data = -2; /* signal neutrino that waiting is pointless */
|
*(long *)data = -2; /* signal neutrino that waiting is pointless */
|
||||||
return -1;
|
fprintf(stderr, "Error: Failed to prepare timerd server with UDS name: %s\n", TIMERD_UDS_NAME);
|
||||||
|
return (void*)EXIT_FAILURE; // return as a `void*`-pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start timer thread
|
// Start timer thread
|
||||||
@@ -502,5 +503,5 @@ int timerd_main_thread(void *data)
|
|||||||
|
|
||||||
timerd_server.run(timerd_parse_command, CTimerdMsg::ACTVERSION);
|
timerd_server.run(timerd_parse_command, CTimerdMsg::ACTVERSION);
|
||||||
printf("timerd shutdown complete\n");
|
printf("timerd shutdown complete\n");
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user