From 41b8a320a01aa891cbe8e3b5350eb878f07817cc Mon Sep 17 00:00:00 2001 From: "jiin.moon" Date: Fri, 4 Mar 2016 15:57:50 -0800 Subject: [PATCH] evas: fix preload thread deadlock issue Summary: Wrong condition makes deadlock issue. Reviewers: jpeg, jypark Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3742 Signed-off-by: Cedric BAIL --- src/lib/evas/cache/evas_cache_image.c | 4 +++- src/lib/evas/include/evas_common_private.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c index e1f8c69..49b1976 100644 --- a/src/lib/evas/cache/evas_cache_image.c +++ b/src/lib/evas/cache/evas_cache_image.c @@ -330,6 +330,7 @@ _evas_cache_image_async_heavy(void *data) current = data; SLKL(current->lock); + current->flags.load_worked = 0; pchannel = current->channel; current->channel++; cache = current->cache; @@ -373,6 +374,7 @@ _evas_cache_image_async_heavy(void *data) current->flags.preload_done = 0; } SLKU(current->lock_cancel); + current->flags.load_worked = 1; SLKU(current->lock); } @@ -1160,7 +1162,7 @@ evas_cache_image_load_data(Image_Entry *im) evas_async_events_process(); LKL(wakeup); - while (im->preload) + while (!im->flags.load_worked) { eina_condition_wait(&cond_wakeup); LKU(wakeup); diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h index 3409e92..1833d54 100644 --- a/src/lib/evas/include/evas_common_private.h +++ b/src/lib/evas/include/evas_common_private.h @@ -568,6 +568,7 @@ struct _Image_Entry_Flags Eina_Bool updated_data : 1; Eina_Bool flipped : 1; Eina_Bool textured : 1; + Eina_Bool load_worked : 1; }; struct _Image_Entry_Frame -- 2.7.4