summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorbsd <bsd@FreeBSD.org>2002-03-15 18:27:58 +0000
committerbsd <bsd@FreeBSD.org>2002-03-15 18:27:58 +0000
commit0c6f58d3470cf7568c992595ca0a1d3208e366a2 (patch)
treed434f05d4637bdc9edb1b9eb82a4b5e69f504bcc /lib/libpthread
parent8d9683ce7e3c0c27be274d75417d7739c4ac6940 (diff)
downloadFreeBSD-src-0c6f58d3470cf7568c992595ca0a1d3208e366a2.zip
FreeBSD-src-0c6f58d3470cf7568c992595ca0a1d3208e366a2.tar.gz
Fix the return code from pthread_rwlock_try[rw|rd]lock() functions;
these should return EBUSY when the calling thread would block. MFC after: 2 weeks
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_rwlock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_rwlock.c b/lib/libpthread/thread/thr_rwlock.c
index 25fab59..2f55f03 100644
--- a/lib/libpthread/thread/thr_rwlock.c
+++ b/lib/libpthread/thread/thr_rwlock.c
@@ -209,7 +209,7 @@ _pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
/* give writers priority over readers */
if (prwlock->blocked_writers || prwlock->state < 0)
- ret = EWOULDBLOCK;
+ ret = EBUSY;
else if (prwlock->state == MAX_READ_LOCKS)
ret = EAGAIN; /* too many read locks acquired */
else
@@ -245,7 +245,7 @@ _pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
return(ret);
if (prwlock->state != 0)
- ret = EWOULDBLOCK;
+ ret = EBUSY;
else
/* indicate we are locked for writing */
prwlock->state = -1;
OpenPOWER on IntegriCloud