From 705ff3f91c5cf873213915cf033796a1c7153448 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sat, 22 Aug 2015 19:29:21 -0400 Subject: Fix the WT_SPINLOCK structure declaration for alignment. Switch to a structure for gcc spinlocks, I couldn't figure out any way to get alignment for an int. (The structure only has a single field, a volatile int, so I don't think the code will be any slower). Remove the typedef on the declaration, it's not needed, the dist scripts with automatically generate it. --- src/include/mutex.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/include/mutex.h') diff --git a/src/include/mutex.h b/src/include/mutex.h index 7d901a38d0d..1f1bb8f4b5c 100644 --- a/src/include/mutex.h +++ b/src/include/mutex.h @@ -65,20 +65,21 @@ struct __wt_rwlock { #if SPINLOCK_TYPE == SPINLOCK_GCC -typedef volatile int WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) - WT_SPINLOCK; +struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_spinlock { + volatile int lock; +}; #elif SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX ||\ SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_ADAPTIVE ||\ SPINLOCK_TYPE == SPINLOCK_MSVC -typedef WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) struct { +struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_spinlock { wt_mutex_t lock; const char *name; /* Statistics: mutex name */ int8_t initialized; /* Lock initialized, for cleanup */ -} WT_SPINLOCK; +}; #else -- cgit v1.2.1