From e5dd18319bbd47c89aac5e1571771958a43e067d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 8 Mar 2011 12:19:30 -0500 Subject: rwlock trylock functions were wrongly returning EAGAIN instead of EBUSY --- src/thread/pthread_rwlock_trywrlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/thread/pthread_rwlock_trywrlock.c') 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; -- cgit v1.2.1