# HG changeset patch # User Timo Sirainen # Date 1296071272 -7200 # Node ID 16ce45dbcb53845072653a83bca46aaa991c08a9 # Parent fc02e620204d8a52bce33fc40765a217926fd42e ioloop: Use -1 for infinite poll/epoll timeout rather than INT_MAX. Should improve performance a tiny bit and also works around a CPU eater bug in Linux 2.6.37. diff -r fc02e620204d -r 16ce45dbcb53 src/lib/ioloop.c --- a/src/lib/ioloop.c Tue Jan 25 00:32:50 2011 +0200 +++ b/src/lib/ioloop.c Wed Jan 26 21:47:52 2011 +0200 @@ -252,11 +252,12 @@ item = priorityq_peek(ioloop->timeouts); timeout = (struct timeout *)item; if (timeout == NULL) { - /* no timeouts. give it INT_MAX msecs. */ + /* no timeouts. use INT_MAX msecs for timeval and + return -1 for poll/epoll infinity. */ tv_r->tv_sec = INT_MAX / 1000; tv_r->tv_usec = 0; ioloop->next_max_time = (1ULL << (TIME_T_MAX_BITS-1)) - 1; - return INT_MAX; + return -1; } tv_now.tv_sec = 0;