add #ifdefs for some threadsafety stuff

cedric SPANK SPANK SPANK!!!


SVN revision: 51105
This commit is contained in:
Mike Blumenkrantz 2010-08-14 03:03:32 +00:00
parent 91df89c40c
commit f973f8c72a
1 changed files with 8 additions and 3 deletions

View File

@ -231,6 +231,7 @@ eina_array_iterator_free(Eina_Iterator_Array *it)
MAGIC_FREE(it); MAGIC_FREE(it);
} }
#ifdef EFL_HAVE_POSIX_THREADS_RWLOCK
static Eina_Bool static Eina_Bool
eina_array_iterator_lock(Eina_Iterator_Array *it) eina_array_iterator_lock(Eina_Iterator_Array *it)
{ {
@ -244,7 +245,7 @@ eina_array_iterator_unlock(Eina_Iterator_Array *it)
EINA_MAGIC_CHECK_ARRAY_ITERATOR(it, EINA_FALSE); EINA_MAGIC_CHECK_ARRAY_ITERATOR(it, EINA_FALSE);
return eina_array_unlock(it->array); return eina_array_unlock(it->array);
} }
#endif
static Eina_Bool static Eina_Bool
eina_array_accessor_get_at(Eina_Accessor_Array *it, eina_array_accessor_get_at(Eina_Accessor_Array *it,
unsigned int idx, unsigned int idx,
@ -275,6 +276,7 @@ eina_array_accessor_free(Eina_Accessor_Array *it)
MAGIC_FREE(it); MAGIC_FREE(it);
} }
#ifdef EFL_HAVE_POSIX_THREADS_RWLOCK
static Eina_Bool static Eina_Bool
eina_array_accessor_lock(Eina_Accessor_Array *it) eina_array_accessor_lock(Eina_Accessor_Array *it)
{ {
@ -288,7 +290,7 @@ eina_array_accessor_unlock(Eina_Accessor_Array *it)
EINA_MAGIC_CHECK_ARRAY_ITERATOR(it, EINA_FALSE); EINA_MAGIC_CHECK_ARRAY_ITERATOR(it, EINA_FALSE);
return eina_array_unlock(it->array); return eina_array_unlock(it->array);
} }
#endif
EAPI Eina_Bool EAPI Eina_Bool
eina_array_grow(Eina_Array *array) eina_array_grow(Eina_Array *array)
{ {
@ -758,11 +760,13 @@ eina_array_iterator_new(const Eina_Array *array)
eina_array_iterator_get_container); eina_array_iterator_get_container);
it->iterator.free = FUNC_ITERATOR_FREE(eina_array_iterator_free); it->iterator.free = FUNC_ITERATOR_FREE(eina_array_iterator_free);
#ifdef EFL_HAVE_POSIX_THREADS_RWLOCK
if (array->threadsafe) if (array->threadsafe)
{ {
it->iterator.lock = FUNC_ITERATOR_LOCK(eina_array_iterator_lock); it->iterator.lock = FUNC_ITERATOR_LOCK(eina_array_iterator_lock);
it->iterator.unlock = FUNC_ITERATOR_LOCK(eina_array_iterator_unlock); it->iterator.unlock = FUNC_ITERATOR_LOCK(eina_array_iterator_unlock);
} }
#endif
return &it->iterator; return &it->iterator;
} }
@ -805,12 +809,13 @@ eina_array_accessor_new(const Eina_Array *array)
eina_array_accessor_get_container); eina_array_accessor_get_container);
it->accessor.free = FUNC_ACCESSOR_FREE(eina_array_accessor_free); it->accessor.free = FUNC_ACCESSOR_FREE(eina_array_accessor_free);
#ifdef EFL_HAVE_POSIX_THREADS_RWLOCK
if (array->threadsafe) if (array->threadsafe)
{ {
it->accessor.lock = FUNC_ACCESSOR_LOCK(eina_array_accessor_lock); it->accessor.lock = FUNC_ACCESSOR_LOCK(eina_array_accessor_lock);
it->accessor.unlock = FUNC_ACCESSOR_LOCK(eina_array_accessor_unlock); it->accessor.unlock = FUNC_ACCESSOR_LOCK(eina_array_accessor_unlock);
} }
#endif
return &it->accessor; return &it->accessor;
} }