Commit 054af139 by Nicola Pero

Fixed backend function of objc_mutex_trylock which was broken

From-SVN: r44104
parent b8dd1bcd
...@@ -331,9 +331,12 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex) ...@@ -331,9 +331,12 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
static inline int static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t mutex)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ()
return pthread_mutex_lock((pthread_mutex_t *)mutex->backend); && pthread_mutex_lock((pthread_mutex_t *)mutex->backend) != 0)
else {
return -1;
}
return 0; return 0;
} }
...@@ -341,9 +344,12 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -341,9 +344,12 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
static inline int static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t mutex)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ()
return pthread_mutex_trylock((pthread_mutex_t *)mutex->backend); && pthread_mutex_trylock((pthread_mutex_t *)mutex->backend) != 0)
else {
return -1;
}
return 0; return 0;
} }
...@@ -351,9 +357,12 @@ __gthread_objc_mutex_trylock(objc_mutex_t mutex) ...@@ -351,9 +357,12 @@ __gthread_objc_mutex_trylock(objc_mutex_t mutex)
static inline int static inline int
__gthread_objc_mutex_unlock(objc_mutex_t mutex) __gthread_objc_mutex_unlock(objc_mutex_t mutex)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ()
return pthread_mutex_unlock((pthread_mutex_t *)mutex->backend); && pthread_mutex_unlock((pthread_mutex_t *)mutex->backend) != 0)
else {
return -1;
}
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment