summaryrefslogtreecommitdiff
path: root/src/thread/pthread_rwlock_trywrlock.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-08 12:19:30 -0500
committerRich Felker <dalias@aerifal.cx>2011-03-08 12:19:30 -0500
commite5dd18319bbd47c89aac5e1571771958a43e067d (patch)
tree71b928d817e04422b7b72c7a6d604fbb0a9e05b3 /src/thread/pthread_rwlock_trywrlock.c
parent7e6be42a77989c01155bdc7333ea58206e1563d4 (diff)
downloadmusl-e5dd18319bbd47c89aac5e1571771958a43e067d.tar.gz
rwlock trylock functions were wrongly returning EAGAIN instead of EBUSY
Diffstat (limited to 'src/thread/pthread_rwlock_trywrlock.c')
-rw-r--r--src/thread/pthread_rwlock_trywrlock.c4
1 files changed, 2 insertions, 2 deletions
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;