this breaks evas? >> evas_image_scalecache.c:437:14: warning: implicit declaration of function 'LKDBG' >> undefined reference to 'LKDBG'
Daniel Juyung Seo (SeoZ) On Sun, May 1, 2011 at 10:25 PM, Enlightenment SVN < [email protected]> wrote: > Log: > and fix up lock goop to work right with improved eina lock goop. i > hope i nixed this bug. > > > > Author: raster > Date: 2011-05-01 06:25:23 -0700 (Sun, 01 May 2011) > New Revision: 59086 > Trac: http://trac.enlightenment.org/e/changeset/59086 > > Modified: > trunk/evas/src/lib/cache/evas_cache_image.c > trunk/evas/src/lib/engines/common/evas_image_scalecache.c > > Modified: trunk/evas/src/lib/cache/evas_cache_image.c > =================================================================== > --- trunk/evas/src/lib/cache/evas_cache_image.c 2011-05-01 13:24:08 UTC > (rev 59085) > +++ trunk/evas/src/lib/cache/evas_cache_image.c 2011-05-01 13:25:23 UTC > (rev 59086) > @@ -629,7 +629,10 @@ > { > evas_async_events_process(); > LKL(wakeup); > - if (cache->pending) pthread_cond_wait(&cond_wakeup, &wakeup); > + // the lazy bum who did eain threads and converted this code > + // didnt bother to worry about Eina_Lock being a different type > + // to a pthread mutex. > + if (cache->pending) pthread_cond_wait(&cond_wakeup, > &(wakeup.mutex)); > LKU(wakeup); > } > #endif > @@ -1139,7 +1142,7 @@ > LKL(wakeup); > while (im->preload) > { > - pthread_cond_wait(&cond_wakeup, &wakeup); > + pthread_cond_wait(&cond_wakeup, &(wakeup.mutex)); > LKU(wakeup); > evas_async_events_process(); > LKL(wakeup); > @@ -1175,7 +1178,7 @@ > evas_cache_image_preload_cancel(im, NULL); > #ifdef BUILD_ASYNC_PRELOAD > LKL(im->lock_cancel); > - if (LKT(im->lock) != 0) /* can't get image lock - busy async load */ > + if (LKT(im->lock) == EINA_FALSE) /* can't get image lock - busy async > load */ > { > im->unload_cancel = EINA_TRUE; > LKU(im->lock_cancel); > > Modified: trunk/evas/src/lib/engines/common/evas_image_scalecache.c > =================================================================== > --- trunk/evas/src/lib/engines/common/evas_image_scalecache.c 2011-05-01 > 13:24:08 UTC (rev 59085) > +++ trunk/evas/src/lib/engines/common/evas_image_scalecache.c 2011-05-01 > 13:25:23 UTC (rev 59086) > @@ -398,19 +398,59 @@ > int dst_region_w, int > dst_region_h) > { > #ifdef SCALECACHE > + int locked = 0; > + Eina_Bool ret; > RGBA_Image *im = (RGBA_Image *)ie; > Scaleitem *sci; > if (!im->image.data) return; > if ((dst_region_w == 0) || (dst_region_h == 0) || > (src_region_w == 0) || (src_region_h == 0)) return; > - LKL(im->cache.lock); > + // was having major lock issues here - LKL was deadlocking. what was > + // going on? it may have been an eina treads badness but this will stay > here > + // for now for debug > +#if 1 > + ret = LKT(im->cache.lock); > + if (ret == EINA_FALSE) /* can't get image lock */ > + { > + useconds_t slp = 1, slpt = 0; > + > + while (slpt < 500000) > + { > + usleep(slp); > + slpt += slp; > + slp++; > + ret = LKT(im->cache.lock); > + if (ret == 2) // MAGIC for now > + { > + printf("WARNING: DEADLOCK on image %p (%s)\n", im, > ie->file); > + } > + else > + { > + locked = 1; > + break; > + } > + } > + if (ret == EINA_FALSE) > + { > + printf("WARNING: lock still there after %i usec\n", slpt); > + printf("WARNING: stucklock on image %p (%s)\n", im, > ie->file); > + LKDBG(im->cache.lock); > + } > + } > + else if (ret == 2) // MAGIC for now > + { > + printf("WARNING: DEADLOCK on image %p (%s)\n", im, ie->file); > + } > + else locked = 1; > +#endif > + if (!locked) { LKL(im->cache.lock); locked = 1; } > use_counter++; > if ((src_region_w == dst_region_w) && (src_region_h == dst_region_h)) > { > // 1:1 scale. > im->cache.orig_usage++; > im->cache.usage_count = use_counter; > - LKU(im->cache.lock); > + if (locked) LKU(im->cache.lock); > return; > } > if ((!im->cache_entry.flags.alpha) && (!smooth)) > @@ -419,7 +459,7 @@ > // or in some cases faster not cached > im->cache.orig_usage++; > im->cache.usage_count = use_counter; > - LKU(im->cache.lock); > + if (locked) LKU(im->cache.lock); > return; > } > LKL(cache_lock); > @@ -429,7 +469,7 @@ > if (!sci) > { > LKU(cache_lock); > - LKU(im->cache.lock); > + if (locked) LKU(im->cache.lock); > return; > } > // INF("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i", > @@ -466,7 +506,7 @@ > if (sci->usage_count > im->cache.newest_usage_count) > im->cache.newest_usage_count = sci->usage_count; > // INF(" -------------- used %8i#, %8i@", (int)sci->usage, > (int)sci->usage_count); > - LKU(im->cache.lock); > + if (locked) LKU(im->cache.lock); > #endif > } > > > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
