static LK(wakeup);
static int _evas_cache_mutex_init = 0;
-static pthread_cond_t cond_wakeup = PTHREAD_COND_INITIALIZER;
+static Eina_Condition cond_wakeup;
static void _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target);
#endif
{
LKI(engine_lock);
LKI(wakeup);
+ eina_condition_new(&cond_wakeup, &wakeup);
}
cache = calloc(1, sizeof(Evas_Cache_Image));
// 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));
+ if (cache->pending) eina_condition_wait(&cond_wakeup);
LKU(wakeup);
}
#endif
if (--_evas_cache_mutex_init == 0)
{
+ eina_condition_free(&cond_wakeup);
LKD(engine_lock);
LKD(wakeup);
}
LKL(wakeup);
while (im->preload)
{
- pthread_cond_wait(&cond_wakeup, &(wakeup.mutex));
+ eina_condition_wait(&cond_wakeup);
LKU(wakeup);
evas_async_events_process();
LKL(wakeup);
evas_cache_image_wakeup(void)
{
#ifdef BUILD_ASYNC_PRELOAD
- pthread_cond_broadcast(&cond_wakeup);
+ eina_condition_broadcast(&cond_wakeup);
#endif
}