From: Rich Felker Date: Tue, 8 Mar 2011 17:19:30 +0000 (-0500) Subject: rwlock trylock functions were wrongly returning EAGAIN instead of EBUSY X-Git-Tag: v0.7.0~31 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e5dd18319bbd47c89aac5e1571771958a43e067d;p=oweals%2Fmusl.git rwlock trylock functions were wrongly returning EAGAIN instead of EBUSY --- diff --git a/src/thread/pthread_rwlock_tryrdlock.c b/src/thread/pthread_rwlock_tryrdlock.c index fc1d5328..f860ec71 100644 --- a/src/thread/pthread_rwlock_tryrdlock.c +++ b/src/thread/pthread_rwlock_tryrdlock.c @@ -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; } diff --git a/src/thread/pthread_rwlock_trywrlock.c b/src/thread/pthread_rwlock_trywrlock.c index 1bcf7c99..202e256a 100644 --- a/src/thread/pthread_rwlock_trywrlock.c +++ b/src/thread/pthread_rwlock_trywrlock.c @@ -3,10 +3,10 @@ int pthread_rwlock_trywrlock(pthread_rwlock_t *rw) { if (a_xchg(&rw->_rw_wrlock, 1)) - return EAGAIN; + return EBUSY; if (rw->_rw_readers) { a_store(&rw->_rw_wrlock, 0); - return EAGAIN; + return EBUSY; } rw->_rw_owner = pthread_self()->tid; return 0;