From 8591de88359dfdbd16a2e41702625216c4fcc486 Mon Sep 17 00:00:00 2001 From: mike_m Date: Tue, 5 Jul 2011 02:32:07 +0000 Subject: [PATCH] ecore: Sleep at least until the next timeout The g_main_loop was spinning waiting for timers that were almost ready. The spinning was due to waking up from the g_main_loop too early, and then having nothing to do. To solve this, round the timeout up to the nearest millisecond, so that when the main loop wakes, the timer will definitely be ready. Signed-off-by: Mike McCormack git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@61028 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore/ecore_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index e6db6a5..f376817 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -463,7 +463,7 @@ _ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time) if (_ecore_timers_exists()) { double t = _ecore_timer_next_get(); - *next_time = (t * 1000.0); + *next_time = ceil(t * 1000.0); } else *next_time = -1; -- 2.7.4