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
This commit is contained in:
Mike McCormack 2011-07-05 02:32:07 +00:00 committed by Mike McCormack
parent d1691ffd70
commit a967e4f98a
1 changed files with 1 additions and 1 deletions

View File

@ -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;