change time_monotonic_ms() from time_t to int64_t

time_monotonic_ms values did wrap every ~24 days, leading to problems
in code that did not cope with that. Instead of fixing all places where
relative comparisons with time_monotonic_ms() are made, just use a
bigger datatype. Convert all users to the new type.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 99ff4857ff
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-09-23 (Sat, 23 Sep 2017)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2017-09-23 21:35:01 +02:00
parent 19da7a493f
commit 267ba4b9f4
11 changed files with 40 additions and 36 deletions

View File

@@ -154,7 +154,7 @@ CSdtThread threadSDT;
#endif
#ifdef DEBUG_EVENT_LOCK
static time_t lockstart = 0;
static int64_t lockstart = 0;
#endif
static int sectionsd_stop = 0;
@@ -209,9 +209,9 @@ inline void unlockEvents(void)
{
#ifdef DEBUG_EVENT_LOCK
if (lockstart) {
time_t tmp = time_monotonic_ms() - lockstart;
int64_t tmp = time_monotonic_ms() - lockstart;
if (tmp > 50)
xprintf("locked ms %d\n", tmp);
xprintf("locked ms %" PRId64 "\n", tmp);
lockstart = 0;
}
#endif
@@ -1485,12 +1485,12 @@ void CTimeThread::run()
* shutdown" hack on with libcoolstream... :-( */
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds);
#else
time_t start = time_monotonic_ms();
int64_t start = time_monotonic_ms();
/* speed up shutdown by looping around Read() */
do {
rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds / 12);
} while (running && rc == 0
&& (time_monotonic_ms() - start) < (time_t)timeoutInMSeconds);
&& (time_monotonic_ms() - start) < (int64_t)timeoutInMSeconds);
#endif
xprintf("%s: get DVB time ch 0x%012" PRIx64 " rc: %d neutrino_sets_time %d\n",
name.c_str(), current_service, rc, messaging_neutrino_sets_time);