forked from enlightenment/efl
revert some changces to try fix lock issues - they create other
nastier ones. SVN revision: 59073
This commit is contained in:
parent
d5b8646544
commit
3aa2f7bb4a
|
@ -207,12 +207,10 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
|
||||||
if (cache->func.debug) cache->func.debug("deleting", ie);
|
if (cache->func.debug) cache->func.debug("deleting", ie);
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
if (ie->flags.delete_me == 1) return;
|
if (ie->flags.delete_me == 1) return;
|
||||||
LKL(ie->lock);
|
|
||||||
if (ie->preload)
|
if (ie->preload)
|
||||||
{
|
{
|
||||||
ie->flags.delete_me = 1;
|
ie->flags.delete_me = 1;
|
||||||
_evas_cache_image_entry_preload_remove(ie, NULL);
|
_evas_cache_image_entry_preload_remove(ie, NULL);
|
||||||
LKU(ie->lock);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -230,10 +228,7 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
|
||||||
cache->func.surface_delete(ie);
|
cache->func.surface_delete(ie);
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
LKU(ie->lock);
|
|
||||||
#ifndef SCALECACHE
|
|
||||||
LKD(ie->lock);
|
LKD(ie->lock);
|
||||||
#endif
|
|
||||||
LKD(ie->lock_cancel);
|
LKD(ie->lock_cancel);
|
||||||
#endif
|
#endif
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
|
@ -308,9 +303,7 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache,
|
||||||
LKI(ie->lock_references);
|
LKI(ie->lock_references);
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
#ifndef SCALECACHE
|
|
||||||
LKI(ie->lock);
|
LKI(ie->lock);
|
||||||
#endif
|
|
||||||
LKI(ie->lock_cancel);
|
LKI(ie->lock_cancel);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -412,22 +405,18 @@ _evas_cache_image_async_end(void *data)
|
||||||
Image_Entry *ie = (Image_Entry *)data;
|
Image_Entry *ie = (Image_Entry *)data;
|
||||||
Evas_Cache_Target *tmp;
|
Evas_Cache_Target *tmp;
|
||||||
|
|
||||||
LKL(ie->lock);
|
|
||||||
ie->cache->preload = eina_list_remove(ie->cache->preload, ie);
|
ie->cache->preload = eina_list_remove(ie->cache->preload, ie);
|
||||||
ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
|
ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
|
||||||
ie->preload = NULL;
|
ie->preload = NULL;
|
||||||
ie->flags.preload_done = ie->flags.loaded;
|
ie->flags.preload_done = ie->flags.loaded;
|
||||||
while ((tmp = ie->targets))
|
while ((tmp = ie->targets))
|
||||||
{
|
{
|
||||||
|
evas_object_inform_call_image_preloaded((Evas_Object*) tmp->target);
|
||||||
ie->targets = (Evas_Cache_Target *)
|
ie->targets = (Evas_Cache_Target *)
|
||||||
eina_inlist_remove(EINA_INLIST_GET(ie->targets),
|
eina_inlist_remove(EINA_INLIST_GET(ie->targets),
|
||||||
EINA_INLIST_GET(ie->targets));
|
EINA_INLIST_GET(ie->targets));
|
||||||
LKU(ie->lock);
|
|
||||||
evas_object_inform_call_image_preloaded((Evas_Object *)tmp->target);
|
|
||||||
LKL(ie->lock);
|
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
LKU(ie->lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -436,19 +425,15 @@ _evas_cache_image_async_cancel(void *data)
|
||||||
Evas_Cache_Image *cache = NULL;
|
Evas_Cache_Image *cache = NULL;
|
||||||
Image_Entry *ie = (Image_Entry *)data;
|
Image_Entry *ie = (Image_Entry *)data;
|
||||||
|
|
||||||
LKL(ie->lock);
|
|
||||||
ie->preload = NULL;
|
ie->preload = NULL;
|
||||||
ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
|
ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
|
||||||
if ((ie->flags.delete_me) || (ie->flags.dirty))
|
if ((ie->flags.delete_me) || (ie->flags.dirty))
|
||||||
{
|
{
|
||||||
ie->flags.delete_me = 0;
|
ie->flags.delete_me = 0;
|
||||||
LKU(ie->lock);
|
|
||||||
_evas_cache_image_entry_delete(ie->cache, ie);
|
_evas_cache_image_entry_delete(ie->cache, ie);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LKU(ie->lock);
|
|
||||||
if (ie->flags.loaded) _evas_cache_image_async_end(ie);
|
if (ie->flags.loaded) _evas_cache_image_async_end(ie);
|
||||||
LKL(ie->lock);
|
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKL(ie->lock_references);
|
LKL(ie->lock_references);
|
||||||
#endif
|
#endif
|
||||||
|
@ -460,7 +445,6 @@ _evas_cache_image_async_cancel(void *data)
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKU(ie->lock_references);
|
LKU(ie->lock_references);
|
||||||
#endif
|
#endif
|
||||||
LKU(ie->lock);
|
|
||||||
if (cache) evas_cache_image_flush(cache);
|
if (cache) evas_cache_image_flush(cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,15 +590,12 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache)
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// XXX: i smell concurrency problem here
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
EINA_LIST_FREE(cache->preload, im)
|
EINA_LIST_FREE(cache->preload, im)
|
||||||
{
|
{
|
||||||
LKL(im->lock);
|
|
||||||
/* By doing that we are protecting us from destroying image when the cache is no longuer available. */
|
/* By doing that we are protecting us from destroying image when the cache is no longuer available. */
|
||||||
im->flags.delete_me = 1;
|
im->flags.delete_me = 1;
|
||||||
_evas_cache_image_entry_preload_remove(im, NULL);
|
_evas_cache_image_entry_preload_remove(im, NULL);
|
||||||
LKU(im->lock);
|
|
||||||
}
|
}
|
||||||
evas_async_events_process();
|
evas_async_events_process();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1142,12 +1123,7 @@ evas_cache_image_load_data(Image_Entry *im)
|
||||||
#endif
|
#endif
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
LKL(im->lock);
|
if (im->flags.loaded) return;
|
||||||
if (im->flags.loaded)
|
|
||||||
{
|
|
||||||
LKU(im->lock);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
if (im->preload)
|
if (im->preload)
|
||||||
{
|
{
|
||||||
|
@ -1165,19 +1141,14 @@ evas_cache_image_load_data(Image_Entry *im)
|
||||||
{
|
{
|
||||||
pthread_cond_wait(&cond_wakeup, &wakeup);
|
pthread_cond_wait(&cond_wakeup, &wakeup);
|
||||||
LKU(wakeup);
|
LKU(wakeup);
|
||||||
LKU(im->lock);
|
|
||||||
evas_async_events_process();
|
evas_async_events_process();
|
||||||
LKL(im->lock);
|
LKL(wakeup);
|
||||||
LKL(wakeup);
|
|
||||||
}
|
}
|
||||||
LKU(wakeup);
|
LKU(wakeup);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (im->flags.loaded)
|
if (im->flags.loaded) return;
|
||||||
{
|
LKL(im->lock);
|
||||||
LKU(im->lock);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
im->flags.in_progress = EINA_TRUE;
|
im->flags.in_progress = EINA_TRUE;
|
||||||
error = im->cache->func.load(im);
|
error = im->cache->func.load(im);
|
||||||
|
@ -1192,7 +1163,6 @@ evas_cache_image_load_data(Image_Entry *im)
|
||||||
_evas_cache_image_entry_surface_alloc(im->cache, im, im->w, im->h);
|
_evas_cache_image_entry_surface_alloc(im->cache, im, im->w, im->h);
|
||||||
im->flags.loaded = 0;
|
im->flags.loaded = 0;
|
||||||
}
|
}
|
||||||
LKU(im->lock);
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
if (preload) _evas_cache_image_async_end(im);
|
if (preload) _evas_cache_image_async_end(im);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue