X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Febase.h;h=d4709418e0dd6583343bb50e583c92783c599952;hp=7fd5af02599bf62589f7e916d42bfd64f08fb29b;hb=6f1188bea106d335f993729e4971770deac88619;hpb=3392a6ecccfe92d342eebe58736d9e33f8332943 diff --git a/lib/base/ebase.h b/lib/base/ebase.h index 7fd5af0..d470941 100644 --- a/lib/base/ebase.h +++ b/lib/base/ebase.h @@ -22,6 +22,11 @@ static inline bool operator<( const timeval &t1, const timeval &t2 ) return t1.tv_sec < t2.tv_sec || (t1.tv_sec == t2.tv_sec && t1.tv_usec < t2.tv_usec); } +static inline bool operator<=( const timeval &t1, const timeval &t2 ) +{ + return t1.tv_sec < t2.tv_sec || (t1.tv_sec == t2.tv_sec && t1.tv_usec <= t2.tv_usec); +} + static inline timeval &operator+=( timeval &t1, const timeval &t2 ) { t1.tv_sec += t2.tv_sec; @@ -175,10 +180,11 @@ class eMainloop int loop_level; void processOneEvent(); int retval; - int timer_offset; pthread_mutex_t recalcLock; + + int m_now_is_invalid; public: - void addTimeOffset(int offset); + static void addTimeOffset(int offset); void addSocketNotifier(eSocketNotifier *sn); void removeSocketNotifier(eSocketNotifier *sn); void addTimer(eTimer* e); @@ -186,8 +192,9 @@ public: static ePtrList existing_loops; eMainloop() - :app_quit_now(0),loop_level(0),retval(0),timer_offset(0) + :app_quit_now(0),loop_level(0),retval(0) { + m_now_is_invalid = 0; existing_loops.push_back(this); pthread_mutex_init(&recalcLock, 0); }