summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-10-11 09:16:47 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-10-11 09:18:10 +0100
commit875e7cf74de68d05f6fd28d26ad8bddab7782316 (patch)
tree1552b7a963ebb32b6b6f1407cfc3b681d6b7c3a4
parent69e27abdc37f222183ce27f4ce0e3fe2a45ca590 (diff)
Revert "eina: use Eina_Spinlock for Eina_Chained_Mempool."
This patch brings in constant E crash for me. It seems to be timing related which somehow leads to a mem corruption. Revert it for now to allow people using E while Cedric looks into it. This reverts commit 12d34309c7c6e3f3041ee576afe93f9ca335059e.
-rw-r--r--ChangeLog3
-rw-r--r--NEWS2
-rw-r--r--src/modules/eina/mp/chained_pool/eina_chained_mempool.c20
3 files changed, 12 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index ba374ef46..bc5ce0c02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,8 +8,7 @@
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,
- Eina_Chained_Mempool.
+ use Eina_Spinlock in Eina_Log, replace Eina_Lock by Eina_Spinlock in Eina_Stringshare.
* 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.
* Ecore: use Eina_Spinlock for Ecore_Thread.
diff --git a/NEWS b/NEWS
index 210b8f55d..fa799cbfc 100644
--- a/NEWS
+++ b/NEWS
@@ -200,7 +200,7 @@ Improvements:
- 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 and chained_mempool.
+ - Use Eina_Spinlock for eina_log, eina_stringshare.
* Eet:
- Display more information with eet -l -v.
- Force thread to always run during eet_cache_concurrency test.
diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
index b71b79dcf..c0257b1f8 100644
--- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
+++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
@@ -83,7 +83,7 @@ struct _Chained_Mempool
#ifdef EINA_HAVE_DEBUG_THREADS
Eina_Thread self;
#endif
- Eina_Spinlock mutex;
+ Eina_Lock mutex;
};
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;
void *mem;
- if (!eina_spinlock_take(&pool->mutex))
+ if (!eina_lock_take(&pool->mutex))
{
#ifdef EINA_HAVE_DEBUG_THREADS
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);
if (!p)
{
- eina_spinlock_release(&pool->mutex);
+ eina_lock_release(&pool->mutex);
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);
- eina_spinlock_release(&pool->mutex);
+ eina_lock_release(&pool->mutex);
return mem;
}
@@ -312,7 +312,7 @@ eina_chained_mempool_free(void *data, void *ptr)
Chained_Pool *p;
// look 4 pool
- if (!eina_spinlock_take(&pool->mutex))
+ if (!eina_lock_take(&pool->mutex))
{
#ifdef EINA_HAVE_DEBUG_THREADS
assert(eina_thread_equal(pool->self, eina_thread_self()));
@@ -343,7 +343,7 @@ eina_chained_mempool_free(void *data, void *ptr)
}
#endif
- eina_spinlock_release(&pool->mutex);
+ eina_lock_release(&pool->mutex);
return;
}
@@ -357,7 +357,7 @@ eina_chained_mempool_repack(void *data,
Chained_Pool *tail;
/* FIXME: Improvement - per Chained_Pool lock */
- if (!eina_spinlock_take(&pool->mutex))
+ if (!eina_lock_take(&pool->mutex))
{
#ifdef EINA_HAVE_DEBUG_THREADS
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 */
- eina_spinlock_release(&pool->mutex);
+ eina_lock_release(&pool->mutex);
}
static void *
@@ -486,7 +486,7 @@ eina_chained_mempool_init(const char *context,
mp->self = eina_thread_self();
#endif
- eina_spinlock_new(&mp->mutex);
+ eina_lock_new(&mp->mutex);
return mp;
}
@@ -524,7 +524,7 @@ eina_chained_mempool_shutdown(void *data)
VALGRIND_DESTROY_MEMPOOL(mp);
#endif
- eina_spinlock_free(&mp->mutex);
+ eina_lock_free(&mp->mutex);
#ifdef EINA_HAVE_DEBUG_THREADS
assert(eina_thread_equal(mp->self, eina_thread_self()));