sectionsd: add debug method to stop startup until EPG is read

This allows for more consistent benchmarking of the event insertion
code. It is not intended for usage in normal setup. Read the comment.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1484 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2011-05-22 16:25:25 +00:00
parent 61573462c8
commit 162a8c5945

View File

@@ -103,6 +103,7 @@
#define TIME_FSEIT_SKIPPING 240
#endif
static bool reader_ready = true;
//#define MAX_EVENTS 6000
static unsigned int max_events;
// sleep 5 minutes
@@ -4701,6 +4702,7 @@ static void *insertEventsfromFile(void *)
printf("[sectionsd] Reading Information finished after %ld miliseconds (%d events)\n",
time_monotonic_ms()-now, ev_count);
}
reader_ready = true;
pthread_exit(NULL);
}
@@ -6894,7 +6896,7 @@ static void *timeThread(void *)
while(!sectionsd_stop)
{
while (!scanning) {
while (!scanning || !reader_ready) {
if(sectionsd_stop)
break;
sleep(1);
@@ -8728,6 +8730,13 @@ void sectionsd_main_thread(void */*data*/)
if (slow_addevent)
printf("====> USING SLOW ADDEVENT. export 'NO_SLOW_ADDEVENT=1' to avoid <===\n");
/* for debugging / benchmarking, "export STARTUP_WAIT=true" to wait with startup for
* the EPG loading to finish
* this wil fail badly if no EPG saving / loading is configured! */
reader_ready = (getenv("STARTUP_WAIT") == NULL);
if (!reader_ready)
printf("====> sectionsd waiting with startup until saved EPG is read <===\n");
SIlanguage::loadLanguages();
tzset(); // TZ auswerten