mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
sectionsd: make sure housekeeping exits on shutdown
This commit is contained in:
@@ -1917,10 +1917,14 @@ static void *houseKeepingThread(void *)
|
|||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rc = HOUSEKEEPING_SLEEP;
|
int i = HOUSEKEEPING_SLEEP;
|
||||||
|
|
||||||
while (rc)
|
while (i > 0 && !sectionsd_stop) {
|
||||||
rc = sleep(rc);
|
sleep(1);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
if (sectionsd_stop)
|
||||||
|
break;
|
||||||
|
|
||||||
while (!scanning) {
|
while (!scanning) {
|
||||||
sleep(1); // wait for streaming to end...
|
sleep(1); // wait for streaming to end...
|
||||||
@@ -2119,7 +2123,12 @@ printf("SIevent size: %d\n", sizeof(SIevent));
|
|||||||
|
|
||||||
xprintf("pausing...\n");
|
xprintf("pausing...\n");
|
||||||
|
|
||||||
|
/* sometimes, pthread_cancel seems to not work, maybe it is a bad idea to mix
|
||||||
|
* plain pthread and OpenThreads? */
|
||||||
|
sectionsd_stop = 1;
|
||||||
pthread_cancel(threadHouseKeeping);
|
pthread_cancel(threadHouseKeeping);
|
||||||
|
xprintf("join Housekeeping\n");
|
||||||
|
pthread_join(threadHouseKeeping, NULL);
|
||||||
|
|
||||||
xprintf("join TOT\n");
|
xprintf("join TOT\n");
|
||||||
threadTIME.Stop();
|
threadTIME.Stop();
|
||||||
|
Reference in New Issue
Block a user