forked from enlightenment/efl
eina: have same behaviour on windows and linux.
SVN revision: 59297
This commit is contained in:
parent
5f820ce976
commit
9e20be0766
|
@ -42,7 +42,9 @@ eina_lock_free(Eina_Lock *mutex)
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
eina_lock_take(Eina_Lock *mutex)
|
eina_lock_take(Eina_Lock *mutex)
|
||||||
{
|
{
|
||||||
|
#ifdef EINA_HAVE_ON_OFF_THREADS
|
||||||
if (!_eina_threads_activated) return EINA_FALSE;
|
if (!_eina_threads_activated) return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
EnterCriticalSection(mutex);
|
EnterCriticalSection(mutex);
|
||||||
|
|
||||||
|
@ -52,7 +54,9 @@ eina_lock_take(Eina_Lock *mutex)
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
eina_lock_take_try(Eina_Lock *mutex)
|
eina_lock_take_try(Eina_Lock *mutex)
|
||||||
{
|
{
|
||||||
|
#ifdef EINA_HAVE_ON_OFF_THREADS
|
||||||
if (!_eina_threads_activated) return EINA_FALSE;
|
if (!_eina_threads_activated) return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return TryEnterCriticalSection(mutex) == 0 ? EINA_FALSE : EINA_TRUE;
|
return TryEnterCriticalSection(mutex) == 0 ? EINA_FALSE : EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +64,9 @@ eina_lock_take_try(Eina_Lock *mutex)
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
eina_lock_release(Eina_Lock *mutex)
|
eina_lock_release(Eina_Lock *mutex)
|
||||||
{
|
{
|
||||||
|
#ifdef EINA_HAVE_ON_OFF_THREADS
|
||||||
if (!_eina_threads_activated) return EINA_FALSE;
|
if (!_eina_threads_activated) return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
LeaveCriticalSection(mutex);
|
LeaveCriticalSection(mutex);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,9 @@ eina_lock_take(Eina_Lock *mutex)
|
||||||
{
|
{
|
||||||
DWORD res;
|
DWORD res;
|
||||||
|
|
||||||
|
#ifdef EINA_HAVE_ON_OFF_THREADS
|
||||||
if (!_eina_threads_activated) return EINA_FALSE;
|
if (!_eina_threads_activated) return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
res = WaitForSingleObject(*mutex, INFINITE);
|
res = WaitForSingleObject(*mutex, INFINITE);
|
||||||
if ((res == WAIT_ABANDONED) || (res == WAIT_FAILED))
|
if ((res == WAIT_ABANDONED) || (res == WAIT_FAILED))
|
||||||
|
@ -64,7 +66,9 @@ eina_lock_take_try(Eina_Lock *mutex)
|
||||||
static inline Eina_Bool
|
static inline Eina_Bool
|
||||||
eina_lock_release(Eina_Lock *mutex)
|
eina_lock_release(Eina_Lock *mutex)
|
||||||
{
|
{
|
||||||
|
#ifdef EINA_HAVE_ON_OFF_THREADS
|
||||||
if (!_eina_threads_activated) return EINA_FALSE;
|
if (!_eina_threads_activated) return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return ReleaseMutex(*mutex);
|
return ReleaseMutex(*mutex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue