mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
Fix g_rwlock_{writer,reader}_trylock
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user