[git commit] linuxthreads.old: fix set-but-unused warning
Mike Frysinger
vapier at gentoo.org
Tue Apr 24 05:39:15 UTC 2012
commit: http://git.uclibc.org/uClibc/commit/?id=22eb98f555772716259538a4613643f0ac4160c1
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Move spin_count down to the code block where it's used to fix the warning:
libpthread/linuxthreads.old/spinlock.c: In function '__pthread_lock':
libpthread/linuxthreads.old/spinlock.c:70:7: warning:
variable 'spin_count' set but not used [-Wunused-but-set-variable]
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
libpthread/linuxthreads.old/spinlock.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libpthread/linuxthreads.old/spinlock.c b/libpthread/linuxthreads.old/spinlock.c
index 24c81d4..7736611 100644
--- a/libpthread/linuxthreads.old/spinlock.c
+++ b/libpthread/linuxthreads.old/spinlock.c
@@ -67,7 +67,6 @@ void internal_function __pthread_lock(struct _pthread_fastlock * lock,
#if defined HAS_COMPARE_AND_SWAP
long oldstatus, newstatus;
int successful_seizure, spurious_wakeup_count;
- int spin_count;
#endif
#if defined TEST_FOR_COMPARE_AND_SWAP
@@ -87,11 +86,11 @@ void internal_function __pthread_lock(struct _pthread_fastlock * lock,
return;
spurious_wakeup_count = 0;
- spin_count = 0;
/* On SMP, try spinning to get the lock. */
#if 0
if (__pthread_smp_kernel) {
+ int spin_count;
int max_count = lock->__spinlock * 2 + 10;
if (max_count > MAX_ADAPTIVE_SPIN_COUNT)
More information about the uClibc-cvs
mailing list