forked from enlightenment/efl
evas - evas_all_sync - only inc loop/retry counter if not advancing
This commit is contained in:
parent
6f5cc5f614
commit
9294568e4c
|
@ -2767,18 +2767,24 @@ evas_render_rendering_wait(Evas_Public_Data *evas)
|
||||||
void
|
void
|
||||||
evas_all_sync(void)
|
evas_all_sync(void)
|
||||||
{
|
{
|
||||||
int loops = 0;
|
int retries = 0, count_before, count;
|
||||||
|
|
||||||
while (_rendering_evases)
|
while (_rendering_evases)
|
||||||
{
|
{
|
||||||
Evas_Public_Data *evas;
|
Evas_Public_Data *evas;
|
||||||
|
|
||||||
|
count_before = eina_list_count(_rendering_evases);
|
||||||
evas = eina_list_data_get(eina_list_last(_rendering_evases));
|
evas = eina_list_data_get(eina_list_last(_rendering_evases));
|
||||||
evas_render_rendering_wait(evas);
|
evas_render_rendering_wait(evas);
|
||||||
loops++;
|
count = eina_list_count(_rendering_evases);
|
||||||
if (loops > 100)
|
if (count < count_before) continue;
|
||||||
|
// this is an error case we never expct - a canvas is busy but waiting
|
||||||
|
// ont it to finish doesnt remove it from the list or somehow the
|
||||||
|
// list grows again so do this retry up to 100 times and then complain
|
||||||
|
retries++;
|
||||||
|
if (retries > 100)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: evas_all_sync did %i loops\n", loops);
|
ERR("Did %i retries while waiting\n", retries);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue