nhttp: enable threading

This is ported from neutrino-mp and contains code by martii and seife
from following commits:
20d3031b8bb47b5af79bf10c385e3564fe5c26dc
93d01c1987726c6ab344f69f799df03d5af8fe7a
363633dc1b9a508e244c7e1e51f6c1bbe699961c
c3e1310a2f727e26ce11669e3aeae78305f87049


Origin commit data
------------------
Branch: ni/coolstream
Commit: 7589a3a9e0
Author: vanhofen <vanhofen@gmx.de>
Date: 2014-08-19 (Tue, 19 Aug 2014)

Origin message was:
------------------
- nhttp: enable threading

This is ported from neutrino-mp and contains code by martii and seife
from following commits:
20d3031b8bb47b5af79bf10c385e3564fe5c26dc
93d01c1987726c6ab344f69f799df03d5af8fe7a
363633dc1b9a508e244c7e1e51f6c1bbe699961c
c3e1310a2f727e26ce11669e3aeae78305f87049


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2014-08-19 13:13:31 +02:00
committed by [CST] Focus
parent 3ee1d987a2
commit 9f817f8dfa
5 changed files with 50 additions and 32 deletions

View File

@@ -144,8 +144,6 @@ void * timerd_main_thread(void *data);
static bool timerd_thread_started = false;
void * nhttpd_main_thread(void *data);
static pthread_t nhttpd_thread ;
static bool nhttpd_thread_started = false;
//#define DISABLE_SECTIONSD
@@ -1955,8 +1953,9 @@ TIMER_START();
dvbsub_init();
pthread_create (&nhttpd_thread, NULL, nhttpd_main_thread, (void *) NULL);
nhttpd_thread_started = true;
pthread_t nhttpd_thread;
if (!pthread_create (&nhttpd_thread, NULL, nhttpd_main_thread, (void *) NULL))
pthread_detach (nhttpd_thread);
CStreamManager::getInstance()->Start();
@@ -3793,12 +3792,6 @@ void stop_daemons(bool stopall, bool for_flash)
delete g_Radiotext;
g_Radiotext = NULL;
}
printf("httpd shutdown\n");
if (nhttpd_thread_started) {
pthread_cancel(nhttpd_thread);
pthread_join(nhttpd_thread, NULL);
}
printf("httpd shutdown done\n");
printf("streaming shutdown\n");
CStreamManager::getInstance()->Stop();
printf("streaming shutdown done\n");