summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-17 13:25:00 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-17 13:27:18 +0100
commit29554c2f4480774ada96cd6c519de64a38c79c60 (patch)
treeae719b2909ad97d28690c4e95af4a806e6d55a1d
parent179ff71c8013ca9e11a547c6759a908e80129b51 (diff)
evas - fix deadlock with sw async rendering calling cbs in post flush
post flush doesnt cleanr evas->rendering until after it calls post flush callbacks. any post flush callback that neexts so access data and block waiting for an async render tyo be done thus blocks forever. this adds a 0.2 sec timeout in case so we at last march on with hiccups instead of totally stalling AND clears evas->rendering before calling the callbacks. @fix
-rw-r--r--src/lib/evas/canvas/evas_render.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 39797221d7..c9bada989a 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1,5 +1,6 @@
1#include "evas_common_private.h" 1#include "evas_common_private.h"
2#include "evas_private.h" 2#include "evas_private.h"
3#include <Ecore.h>
3#include <math.h> 4#include <math.h>
4#include <assert.h> 5#include <assert.h>
5 6
@@ -2745,7 +2746,16 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void *context,
2745void 2746void
2746evas_render_rendering_wait(Evas_Public_Data *evas) 2747evas_render_rendering_wait(Evas_Public_Data *evas)
2747{ 2748{
2748 while (evas->rendering) evas_async_events_process_blocking(); 2749 double t0 = ecore_time_get();
2750 while (evas->rendering)
2751 {
2752 evas_async_events_process_blocking();
2753 if ((ecore_time_get() - t0) > 0.2)
2754 {
2755 ERR("timeout waiting for async rendering");
2756 break;
2757 }
2758 }
2749} 2759}
2750 2760
2751/* 2761/*
@@ -3894,6 +3904,10 @@ evas_render_wakeup(Evas *eo_e)
3894 } 3904 }
3895 eina_spinlock_release(&(evas->render.lock)); 3905 eina_spinlock_release(&(evas->render.lock));
3896 3906
3907 /* post rendering */
3908 _rendering_evases = eina_list_remove_list(_rendering_evases, evas->rendering);
3909 evas->rendering = NULL;
3910
3897 /* flush redraws */ 3911 /* flush redraws */
3898 if (haveup) 3912 if (haveup)
3899 { 3913 {
@@ -3941,10 +3955,6 @@ evas_render_wakeup(Evas *eo_e)
3941 free(job); 3955 free(job);
3942 } 3956 }
3943 3957
3944 /* post rendering */
3945 _rendering_evases = eina_list_remove_list(_rendering_evases, evas->rendering);
3946 evas->rendering = NULL;
3947
3948 post.updated_area = ret_updates; 3958 post.updated_area = ret_updates;
3949 _cb_always_call(eo_e, evas, EVAS_CALLBACK_RENDER_POST, &post); 3959 _cb_always_call(eo_e, evas, EVAS_CALLBACK_RENDER_POST, &post);
3950 evas->inside_post_render = EINA_FALSE; 3960 evas->inside_post_render = EINA_FALSE;