exit(0);
}
-
+/**
+ *
+ */
+void
+dispatch_clock_update(struct timespec *ts)
+{
+ struct timespec ts1;
+ if (ts == NULL)
+ ts = &ts1;
+ clock_gettime(CLOCK_REALTIME, ts);
+
+ /* 1sec stuff */
+ if (ts->tv_sec > dispatch_clock) {
+ dispatch_clock = ts->tv_sec;
+ comet_flush(); /* Flush idle comet mailboxes */
+ }
+}
/**
*
#endif
while(tvheadend_running) {
- clock_gettime(CLOCK_REALTIME, &ts);
-
- /* 1sec stuff */
- if (ts.tv_sec > dispatch_clock) {
- dispatch_clock = ts.tv_sec;
-
- comet_flush(); /* Flush idle comet mailboxes */
- }
+ dispatch_clock_update(&ts);
/* Global timers */
pthread_mutex_lock(&global_lock);
#endif
#include <pthread.h>
#include <stdarg.h>
+#include <time.h>
#include "htsmsg.h"
#define tvhnotice(...) tvhlog(LOG_NOTICE, ##__VA_ARGS__)
#define tvherror(...) tvhlog(LOG_ERR, ##__VA_ARGS__)
+void dispatch_clock_update(struct timespec *ts);
+
#endif /* __TVH_LOGGING_H__ */