2013-10-11 Cedric Bail
* Eina: add Eina_Spinlock API,
- use Eina_Spinlock in Eina_Log, replace Eina_Lock by Eina_Spinlock in Eina_Stringshare.
+ use Eina_Spinlock in Eina_Log, replace Eina_Lock by Eina_Spinlock in Eina_Stringshare,
+ Eina_Chained_Mempool.
* Eet: replace Eina_Lock by Eina_Spinlock in Eet_Dictionnary.
2013-10-10 Carsten Haitzler (The Rasterman)
- Eina_Tiler now take tile size into account.
- Improve support for 64bits system.
- eina_strlcat now work with a NULL source.
- - Use Eina_Spinlock for eina_log, eina_stringshare.
+ - Use Eina_Spinlock for eina_log, eina_stringshare and chained_mempool.
* Eet:
- Display more information with eet -l -v.
- Force thread to always run during eet_cache_concurrency test.
#ifdef EINA_HAVE_DEBUG_THREADS
Eina_Thread self;
#endif
- Eina_Lock mutex;
+ Eina_Spinlock mutex;
};
typedef struct _Chained_Pool Chained_Pool;
Chained_Pool *p = NULL;
void *mem;
- if (!eina_lock_take(&pool->mutex))
+ if (!eina_spinlock_take(&pool->mutex))
{
#ifdef EINA_HAVE_DEBUG_THREADS
assert(eina_thread_equal(pool->self, eina_thread_self()));
p = _eina_chained_mp_pool_new(pool);
if (!p)
{
- eina_lock_release(&pool->mutex);
+ eina_spinlock_release(&pool->mutex);
return NULL;
}
mem = _eina_chained_mempool_alloc_in(pool, p);
- eina_lock_release(&pool->mutex);
+ eina_spinlock_release(&pool->mutex);
return mem;
}
Chained_Pool *p;
// look 4 pool
- if (!eina_lock_take(&pool->mutex))
+ if (!eina_spinlock_take(&pool->mutex))
{
#ifdef EINA_HAVE_DEBUG_THREADS
assert(eina_thread_equal(pool->self, eina_thread_self()));
}
#endif
- eina_lock_release(&pool->mutex);
+ eina_spinlock_release(&pool->mutex);
return;
}
Chained_Pool *tail;
/* FIXME: Improvement - per Chained_Pool lock */
- if (!eina_lock_take(&pool->mutex))
+ if (!eina_spinlock_take(&pool->mutex))
{
#ifdef EINA_HAVE_DEBUG_THREADS
assert(eina_thread_equal(pool->self, eina_thread_self()));
}
/* FIXME: improvement - reorder pool so that the most used one get in front */
- eina_lock_release(&pool->mutex);
+ eina_spinlock_release(&pool->mutex);
}
static void *
mp->self = eina_thread_self();
#endif
- eina_lock_new(&mp->mutex);
+ eina_spinlock_new(&mp->mutex);
return mp;
}
VALGRIND_DESTROY_MEMPOOL(mp);
#endif
- eina_lock_free(&mp->mutex);
+ eina_spinlock_free(&mp->mutex);
#ifdef EINA_HAVE_DEBUG_THREADS
assert(eina_thread_equal(mp->self, eina_thread_self()));