summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-07-05 02:32:07 +0000
committerMike McCormack <mikem@ring3k.org>2011-07-05 02:32:07 +0000
commita967e4f98ac3d3d4d5466fe0b7201711c633a50b (patch)
tree28dcead75408322828ab01b16742b7085d2fb3e8 /legacy/ecore/src/lib/ecore/ecore_main.c
parentd1691ffd7087d2444d12ccb8af1b26e36b4fbb8a (diff)
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 <mj.mccormack@samsung.com> SVN revision: 61028
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index e6db6a5a20..f37681712d 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -463,7 +463,7 @@ _ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time)
463 if (_ecore_timers_exists()) 463 if (_ecore_timers_exists())
464 { 464 {
465 double t = _ecore_timer_next_get(); 465 double t = _ecore_timer_next_get();
466 *next_time = (t * 1000.0); 466 *next_time = ceil(t * 1000.0);
467 } 467 }
468 else 468 else
469 *next_time = -1; 469 *next_time = -1;