X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2FIOEngine_select.c;fp=src%2FIOEngine_select.c;h=aff5fb920f264e47caa8ce9a86772cb7fcf0a6dd;hp=48d7fed5c4a6b40898addb2b5247f11ea615bf5c;hb=f83bd22fe2dcb3ca0ddb9321944ee0b9c9b61ea6;hpb=6b235c4b3e0ff537bff312c5f18104e657b02883 diff --git a/src/IOEngine_select.c b/src/IOEngine_select.c index 48d7fed..aff5fb9 100644 --- a/src/IOEngine_select.c +++ b/src/IOEngine_select.c @@ -120,8 +120,14 @@ static void engine_select_loop(struct timeval *timeout) { tdiff.tv_sec = timer_priority->timeout.tv_sec - now.tv_sec; tdiff.tv_usec = timer_priority->timeout.tv_usec - now.tv_usec; if(tdiff.tv_sec < 0 || (tdiff.tv_sec == 0 && tdiff.tv_usec <= 0)) { - iohandler_events(timer_priority, 0, 0); - iohandler_close(timer_priority); //also sets timer_priority to the next timed element + if(timer_priority->constant_timeout) { + tdiff.tv_sec = 0; + iohandler_set_timeout(timer_priority, &tdiff); + iohandler_events(timer_priority, 0, 0); + } else { + iohandler_events(timer_priority, 0, 0); + iohandler_close(timer_priority); //also sets timer_priority to the next timed element + } continue; } else if(tdiff.tv_usec < 0) { tdiff.tv_sec--; @@ -182,8 +188,14 @@ static void engine_select_loop(struct timeval *timeout) { engine_select_timer_delay_fix = ((engine_select_timer_delay_fix * 19) + timer_fix) / 20; iohandler_log(IOLOG_DEBUG, "timer delay fix set to: %d us", engine_select_timer_delay_fix); } - iohandler_events(timer_priority, 0, 0); - iohandler_close(timer_priority); //also sets timer_priority to the next timed element + if(timer_priority->constant_timeout) { + tdiff.tv_sec = 0; + iohandler_set_timeout(timer_priority, &tdiff); + iohandler_events(timer_priority, 0, 0); + } else { + iohandler_events(timer_priority, 0, 0); + iohandler_close(timer_priority); //also sets timer_priority to the next timed element + } continue; } break;