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;
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);
static ePtrList<eMainloop> 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);
}