cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=41b8a320a01aa891cbe8e3b5350eb878f07817cc

commit 41b8a320a01aa891cbe8e3b5350eb878f07817cc
Author: jiin.moon <jiin.m...@samsung.com>
Date:   Fri Mar 4 15:57:50 2016 -0800

    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 <ced...@osg.samsung.com>
---
 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

-- 


Reply via email to