rwlock trylock functions were wrongly returning EAGAIN instead of EBUSY
[musl] / src / thread / pthread_rwlock_tryrdlock.c
index fc1d532..f860ec7 100644 (file)
@@ -7,7 +7,7 @@ int pthread_rwlock_tryrdlock(pthread_rwlock_t *rw)
                a_dec(&rw->_rw_readers);
                if (rw->_rw_waiters && !rw->_rw_readers)
                        __wake(&rw->_rw_readers, 1, 0);
-               return EAGAIN;
+               return EBUSY;
        }
        return 0;
 }