fix possible thread lock issue - scalecache wasnt locked in 1
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 11 Jan 2011 05:43:10 +0000 (05:43 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 11 Jan 2011 05:43:10 +0000 (05:43 +0000)
circumstance.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56037 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_image_scalecache.c

index c479e32..9fc5313 100644 (file)
@@ -247,6 +247,7 @@ _sci_find(RGBA_Image *im,
           _sci_fix_newest(im);
         if (sci->im)
           {
+             LKL(cache_lock);
              evas_common_rgba_image_free(&sci->im->cache_entry);
              if (!sci->forced_unload)
                cache_size -= sci->dst_w * sci->dst_h * 4;
@@ -254,6 +255,7 @@ _sci_find(RGBA_Image *im,
                cache_size -= sci->size_adjust;
 //             INF(" 1- %i", sci->dst_w * sci->dst_h * 4);
              cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
+             LKU(cache_lock);
           }
 #ifdef EVAS_FRAME_QUEUING
         RWLKU(sci->lock);
@@ -309,6 +311,7 @@ _cache_prune(Scaleitem *notsci, Eina_Bool copies_only)
 #endif
         if (sci->im)
           {
+             LKL(cache_lock);
              evas_common_rgba_image_free(&sci->im->cache_entry);
              sci->im = NULL;
              sci->usage = 0;
@@ -321,6 +324,7 @@ _cache_prune(Scaleitem *notsci, Eina_Bool copies_only)
 //             INF(" 2- %i", sci->dst_w * sci->dst_h * 4);
              cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
              memset(sci, 0, sizeof(Eina_Inlist));
+             LKU(cache_lock);
           }
 #ifdef EVAS_FRAME_QUEUING
         RWLKU(sci->lock);