[glib] Fix g_rec_mutex_trylock



commit 9de564bf1f0f0c874ea311479f1561158e0d55e8
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 22 21:58:28 2011 -0400

    Fix g_rec_mutex_trylock

 glib/gthread-posix.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
index e8028d8..c002e4c 100644
--- a/glib/gthread-posix.c
+++ b/glib/gthread-posix.c
@@ -277,7 +277,10 @@ g_rec_mutex_unlock (GRecMutex *mutex)
 gboolean
 g_rec_mutex_trylock (GRecMutex *mutex)
 {
-  return pthread_mutex_trylock (g_rec_mutex_get_impl (mutex));
+  if (pthread_mutex_trylock (g_rec_mutex_get_impl (mutex)) != 0)
+    return FALSE;
+
+  return TRUE;
 }
 
 /* {{{1 GRWLock */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]