From 0bfb874e21c8552b50d2736803567fd28cb29a58 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 24 Sep 2012 16:40:24 +0200 Subject: [PATCH] added additional iohandler_poll_timeout function --- src/IOHandler.c | 10 +++++++--- src/IOHandler.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/IOHandler.c b/src/IOHandler.c index 81d8d09..db9a599 100644 --- a/src/IOHandler.c +++ b/src/IOHandler.c @@ -706,11 +706,15 @@ void iohandler_events(struct IODescriptor *iofd, int readable, int writeable) { } void iohandler_poll() { + struct timeval timeout; + timeout.tv_sec = IO_MAX_TIMEOUT; + timeout.tv_usec = 0; + iohandler_poll_timeout(timeout); +} + +void iohandler_poll_timeout(struct timeval timeout) { if(engine) { IOSYNCHRONIZE(io_poll_sync); //quite senceless multithread support... better support will follow - struct timeval timeout; - timeout.tv_sec = IO_MAX_TIMEOUT; - timeout.tv_usec = 0; engine->loop(&timeout); IODESYNCHRONIZE(io_poll_sync); } diff --git a/src/IOHandler.h b/src/IOHandler.h index 208b854..b0a6c6b 100644 --- a/src/IOHandler.h +++ b/src/IOHandler.h @@ -117,5 +117,6 @@ void iohandler_update(struct IODescriptor *iofd); void iohandler_set_timeout(struct IODescriptor *iofd, struct timeval *timeout); void iohandler_poll(); +void iohandler_poll_timeout(struct timeval timeout); #endif -- 2.20.1