forked from enlightenment/efl
fix locking around entry_surface_alloc.
we must make sure flags are consistent with actual values, so lock around use and set of these variables as well. SVN revision: 38322
This commit is contained in:
parent
297858d10c
commit
363ddc283d
|
@ -254,6 +254,27 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache,
|
||||||
return ie;
|
return ie;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_evas_cache_image_entry_surface_alloc__locked(Evas_Cache_Image *cache,
|
||||||
|
Image_Entry *ie,
|
||||||
|
int wmin,
|
||||||
|
int hmin)
|
||||||
|
{
|
||||||
|
if (ie->allocated.w == wmin && ie->allocated.h == hmin)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
if (cache->func.surface_alloc(ie, wmin, hmin))
|
||||||
|
{
|
||||||
|
wmin = 0;
|
||||||
|
hmin = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ie->w = wmin;
|
||||||
|
ie->h = hmin;
|
||||||
|
ie->allocated.w = wmin;
|
||||||
|
ie->allocated.h = hmin;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_entry_surface_alloc(Evas_Cache_Image *cache,
|
_evas_cache_image_entry_surface_alloc(Evas_Cache_Image *cache,
|
||||||
Image_Entry *ie,
|
Image_Entry *ie,
|
||||||
|
@ -265,27 +286,14 @@ _evas_cache_image_entry_surface_alloc(Evas_Cache_Image *cache,
|
||||||
|
|
||||||
wmin = w > 0 ? w : 1;
|
wmin = w > 0 ? w : 1;
|
||||||
hmin = h > 0 ? h : 1;
|
hmin = h > 0 ? h : 1;
|
||||||
if (ie->allocated.w == wmin && ie->allocated.h == hmin)
|
|
||||||
return ;
|
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
pthread_mutex_lock(&mutex_surface_alloc);
|
pthread_mutex_lock(&mutex_surface_alloc);
|
||||||
#endif
|
#endif
|
||||||
|
_evas_cache_image_entry_surface_alloc__locked(cache, ie, wmin, hmin);
|
||||||
if (cache->func.surface_alloc(ie, wmin, hmin))
|
|
||||||
{
|
|
||||||
wmin = 0;
|
|
||||||
hmin = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
pthread_mutex_unlock(&mutex_surface_alloc);
|
pthread_mutex_unlock(&mutex_surface_alloc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ie->w = wmin;
|
|
||||||
ie->h = hmin;
|
|
||||||
ie->allocated.w = wmin;
|
|
||||||
ie->allocated.h = hmin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
|
|
Loading…
Reference in New Issue