fixbug timeout is in milliseconds...

This commit is contained in:
Yecheng Fu
2012-11-27 23:56:21 +08:00
parent 655a2b6acc
commit 6aca76ec7c
2 changed files with 4 additions and 4 deletions

View File

@@ -117,8 +117,8 @@ _read_queue(struct connection_pool * pool, int timeout) {
int n = epoll_wait(pool->epoll_fd , pool->ev, EPOLLQUEUE, timeout);
#elif HAVE_KQUEUE
struct timespec timeoutspec;
timeoutspec.tv_sec = timeout;
timeoutspec.tv_nsec = 0;
timeoutspec.tv_sec = timeout / 1000;
timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
int n = kevent(pool->kqueue_fd, NULL, 0, pool->ev, EPOLLQUEUE, &timeoutspec);
#endif
if (n == -1) {

View File

@@ -235,8 +235,8 @@ _read_queue(struct mread_pool * self, int timeout) {
int n = epoll_wait(self->epoll_fd , self->ev, READQUEUE, timeout);
#elif HAVE_KQUEUE
struct timespec timeoutspec;
timeoutspec.tv_sec = timeout;
timeoutspec.tv_nsec = 0;
timeoutspec.tv_sec = timeout / 1000;
timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
int n = kevent(self->kqueue_fd, NULL, 0, self->ev, READQUEUE, &timeoutspec);
#endif
if (n == -1) {