From 8001df6f90daf0e9c80f391859438fdd1835fd5c Mon Sep 17 00:00:00 2001 From: davidxu Date: Sun, 23 Apr 2006 11:23:37 +0000 Subject: Remove multiple _get_curthread() calls. --- lib/libthr/thread/thr_rwlock.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libthr') diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index ea2c763..81d1459 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--; -- cgit v1.1