forked from enlightenment/efl
Revert "Revert "eina: use Eina_Spinlock for Eina_Chained_Mempool.""
Revert now that it is fixed in eina.
This reverts commit 875e7cf74d
.
This commit is contained in:
parent
ab0f7ca625
commit
ac89c082a4
|
@ -8,7 +8,8 @@
|
||||||
2013-10-11 Cedric Bail
|
2013-10-11 Cedric Bail
|
||||||
|
|
||||||
* Eina: add Eina_Spinlock API,
|
* 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.
|
* Eet: replace Eina_Lock by Eina_Spinlock in Eet_Dictionnary.
|
||||||
* Evas: replace Eina_Lock by Eina_Spinlock in Evas_ScaleCache, Evas_Async_Events and Image_Entry.
|
* Evas: replace Eina_Lock by Eina_Spinlock in Evas_ScaleCache, Evas_Async_Events and Image_Entry.
|
||||||
* Ecore: use Eina_Spinlock for Ecore_Thread.
|
* Ecore: use Eina_Spinlock for Ecore_Thread.
|
||||||
|
|
2
NEWS
2
NEWS
|
@ -200,7 +200,7 @@ Improvements:
|
||||||
- Eina_Tiler now take tile size into account.
|
- Eina_Tiler now take tile size into account.
|
||||||
- Improve support for 64bits system.
|
- Improve support for 64bits system.
|
||||||
- eina_strlcat now work with a NULL source.
|
- 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:
|
* Eet:
|
||||||
- Display more information with eet -l -v.
|
- Display more information with eet -l -v.
|
||||||
- Force thread to always run during eet_cache_concurrency test.
|
- Force thread to always run during eet_cache_concurrency test.
|
||||||
|
|
|
@ -83,7 +83,7 @@ struct _Chained_Mempool
|
||||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||||
Eina_Thread self;
|
Eina_Thread self;
|
||||||
#endif
|
#endif
|
||||||
Eina_Lock mutex;
|
Eina_Spinlock mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _Chained_Pool Chained_Pool;
|
typedef struct _Chained_Pool Chained_Pool;
|
||||||
|
@ -262,7 +262,7 @@ eina_chained_mempool_malloc(void *data, EINA_UNUSED unsigned int size)
|
||||||
Chained_Pool *p = NULL;
|
Chained_Pool *p = NULL;
|
||||||
void *mem;
|
void *mem;
|
||||||
|
|
||||||
if (!eina_lock_take(&pool->mutex))
|
if (!eina_spinlock_take(&pool->mutex))
|
||||||
{
|
{
|
||||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||||
assert(eina_thread_equal(pool->self, eina_thread_self()));
|
assert(eina_thread_equal(pool->self, eina_thread_self()));
|
||||||
|
@ -288,7 +288,7 @@ eina_chained_mempool_malloc(void *data, EINA_UNUSED unsigned int size)
|
||||||
p = _eina_chained_mp_pool_new(pool);
|
p = _eina_chained_mp_pool_new(pool);
|
||||||
if (!p)
|
if (!p)
|
||||||
{
|
{
|
||||||
eina_lock_release(&pool->mutex);
|
eina_spinlock_release(&pool->mutex);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ eina_chained_mempool_malloc(void *data, EINA_UNUSED unsigned int size)
|
||||||
|
|
||||||
mem = _eina_chained_mempool_alloc_in(pool, p);
|
mem = _eina_chained_mempool_alloc_in(pool, p);
|
||||||
|
|
||||||
eina_lock_release(&pool->mutex);
|
eina_spinlock_release(&pool->mutex);
|
||||||
|
|
||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ eina_chained_mempool_free(void *data, void *ptr)
|
||||||
Chained_Pool *p;
|
Chained_Pool *p;
|
||||||
|
|
||||||
// look 4 pool
|
// look 4 pool
|
||||||
if (!eina_lock_take(&pool->mutex))
|
if (!eina_spinlock_take(&pool->mutex))
|
||||||
{
|
{
|
||||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||||
assert(eina_thread_equal(pool->self, eina_thread_self()));
|
assert(eina_thread_equal(pool->self, eina_thread_self()));
|
||||||
|
@ -343,7 +343,7 @@ eina_chained_mempool_free(void *data, void *ptr)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eina_lock_release(&pool->mutex);
|
eina_spinlock_release(&pool->mutex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ eina_chained_mempool_repack(void *data,
|
||||||
Chained_Pool *tail;
|
Chained_Pool *tail;
|
||||||
|
|
||||||
/* FIXME: Improvement - per Chained_Pool lock */
|
/* FIXME: Improvement - per Chained_Pool lock */
|
||||||
if (!eina_lock_take(&pool->mutex))
|
if (!eina_spinlock_take(&pool->mutex))
|
||||||
{
|
{
|
||||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||||
assert(eina_thread_equal(pool->self, eina_thread_self()));
|
assert(eina_thread_equal(pool->self, eina_thread_self()));
|
||||||
|
@ -430,7 +430,7 @@ eina_chained_mempool_repack(void *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: improvement - reorder pool so that the most used one get in front */
|
/* 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 *
|
static void *
|
||||||
|
@ -486,7 +486,7 @@ eina_chained_mempool_init(const char *context,
|
||||||
mp->self = eina_thread_self();
|
mp->self = eina_thread_self();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eina_lock_new(&mp->mutex);
|
eina_spinlock_new(&mp->mutex);
|
||||||
|
|
||||||
return mp;
|
return mp;
|
||||||
}
|
}
|
||||||
|
@ -524,7 +524,7 @@ eina_chained_mempool_shutdown(void *data)
|
||||||
VALGRIND_DESTROY_MEMPOOL(mp);
|
VALGRIND_DESTROY_MEMPOOL(mp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eina_lock_free(&mp->mutex);
|
eina_spinlock_free(&mp->mutex);
|
||||||
|
|
||||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||||
assert(eina_thread_equal(mp->self, eina_thread_self()));
|
assert(eina_thread_equal(mp->self, eina_thread_self()));
|
||||||
|
|
Loading…
Reference in New Issue