projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff13913
)
Fix g_rwlock_{writer,reader}_trylock
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 23 Sep 2011 02:44:05 +0000
(22:44 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Fri, 23 Sep 2011 02:45:47 +0000
(22:45 -0400)
glib/gthread-posix.c
patch
|
blob
|
history
diff --git
a/glib/gthread-posix.c
b/glib/gthread-posix.c
index
c002e4c
..
ca2703c
100644
(file)
--- a/
glib/gthread-posix.c
+++ b/
glib/gthread-posix.c
@@
-306,7
+306,10
@@
g_rw_lock_writer_lock (GRWLock *lock)
gboolean
g_rw_lock_writer_trylock (GRWLock *lock)
{
- return pthread_rwlock_trywrlock (&lock->impl);
+ if (pthread_rwlock_trywrlock (&lock->impl) != 0)
+ return FALSE;
+
+ return TRUE;
}
void
@@
-324,7
+327,10
@@
g_rw_lock_reader_lock (GRWLock *lock)
gboolean
g_rw_lock_reader_trylock (GRWLock *lock)
{
- return pthread_rwlock_tryrdlock (&lock->impl);
+ if (pthread_rwlock_tryrdlock (&lock->impl) != 0)
+ return FALSE;
+
+ return TRUE;
}
void