Re: {sys_,/dev/}epoll waiting timeout

From: Ed Tomlinson (tomlins@cam.org)
Date: Wed Jan 22 2003 - 07:46:24 EST


Jamie Lokier wrote:

> jtimeout = 0;
> if (timeout) {
> /* Careful about overflow in the intermediate values */
> if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ)
> jtimeout = (unsigned long)(timeout*HZ+999)/1000+1;
> else /* Negative or overflow */
> jtimeout = MAX_SCHEDULE_TIMEOUT;
> }

Why assume HZ=1000? Would not:

timeout = (unsigned long)(timeout*HZ+(HZ-1))/HZ+1;

make more sense?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:29 EST