summaryrefslogtreecommitdiff
path: root/src/lib/evas
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-20 08:52:32 +0100
commitdb8e59835193ef9b041cb36dae8b96232be3da08 (patch)
treeb05eabfc2720126c42f87760ffe16e172bbfe557 /src/lib/evas
parent4b4c208d99358941cfe886bc1a87e38c2390f0bd (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
Diffstat (limited to 'src/lib/evas')
-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 18c872bd39..c356995b55 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
@@ -2748,7 +2749,16 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void *context,
2748void 2749void
2749evas_render_rendering_wait(Evas_Public_Data *evas) 2750evas_render_rendering_wait(Evas_Public_Data *evas)
2750{ 2751{
2751 while (evas->rendering) evas_async_events_process_blocking(); 2752 double t0 = ecore_time_get();
2753 while (evas->rendering)
2754 {
2755 evas_async_events_process_blocking();
2756 if ((ecore_time_get() - t0) > 0.2)
2757 {
2758 ERR("timeout waiting for async rendering");
2759 break;
2760 }
2761 }
2752} 2762}
2753 2763
2754/* 2764/*
@@ -3939,6 +3949,10 @@ evas_render_wakeup(Evas *eo_e)
3939 } 3949 }
3940 eina_spinlock_release(&(evas->render.lock)); 3950 eina_spinlock_release(&(evas->render.lock));
3941 3951
3952 /* post rendering */
3953 _rendering_evases = eina_list_remove_list(_rendering_evases, evas->rendering);
3954 evas->rendering = NULL;
3955
3942 /* flush redraws */ 3956 /* flush redraws */
3943 if (haveup) 3957 if (haveup)
3944 { 3958 {
@@ -3986,10 +4000,6 @@ evas_render_wakeup(Evas *eo_e)
3986 free(job); 4000 free(job);
3987 } 4001 }
3988 4002
3989 /* post rendering */
3990 _rendering_evases = eina_list_remove_list(_rendering_evases, evas->rendering);
3991 evas->rendering = NULL;
3992
3993 post.updated_area = ret_updates; 4003 post.updated_area = ret_updates;
3994 _cb_always_call(eo_e, evas, EVAS_CALLBACK_RENDER_POST, &post); 4004 _cb_always_call(eo_e, evas, EVAS_CALLBACK_RENDER_POST, &post);
3995 evas->inside_post_render = EINA_FALSE; 4005 evas->inside_post_render = EINA_FALSE;