summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2006-04-23 11:23:37 +0000
committerDavid Xu <davidxu@FreeBSD.org>2006-04-23 11:23:37 +0000
commitd96413eaa43764d03ffb51e4a0895fa0390aa4b4 (patch)
treecbe40e36ef40b6163d0430b93340e73d13b94066
parent61fb5e6e55114bed3001de2f0c905a42fa1d2ef3 (diff)
Notes
-rw-r--r--lib/libthr/thread/thr_rwlock.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c
index ea2c7631e258..81d145976245 100644
--- a/lib/libthr/thread/thr_rwlock.c
+++ b/lib/libthr/thread/thr_rwlock.c
@@ -172,7 +172,6 @@ rwlock_rdlock_common (pthread_rwlock_t *rwlock, const struct timespec *abstime)
return (EAGAIN);
}
- curthread = _get_curthread();
if ((curthread->rdlock_count > 0) && (prwlock->state > 0)) {
/*
* To avoid having to track all the rdlocks held by
@@ -256,7 +255,6 @@ _pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
if ((ret = _pthread_mutex_lock(&prwlock->lock)) != 0)
return (ret);
- curthread = _get_curthread();
if (prwlock->state == MAX_READ_LOCKS)
ret = EAGAIN;
else if ((curthread->rdlock_count > 0) && (prwlock->state > 0)) {
@@ -317,7 +315,7 @@ _pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
int
_pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
{
- struct pthread *curthread;
+ struct pthread *curthread = _get_curthread();
pthread_rwlock_t prwlock;
int ret;
@@ -333,7 +331,6 @@ _pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
if ((ret = _pthread_mutex_lock(&prwlock->lock)) != 0)
return (ret);
- curthread = _get_curthread();
if (prwlock->state > 0) {
curthread->rdlock_count--;
prwlock->state--;