summaryrefslogtreecommitdiff
path: root/src/include/mutex.h
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-08-22 19:29:21 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-08-22 19:29:21 -0400
commit705ff3f91c5cf873213915cf033796a1c7153448 (patch)
tree23d0760ba6d34c37191dc63c1ed4ad5a74743532 /src/include/mutex.h
parent075077713d22d1361d2a1585d8e63ee9c48cc6bf (diff)
downloadmongo-705ff3f91c5cf873213915cf033796a1c7153448.tar.gz
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.
Diffstat (limited to 'src/include/mutex.h')
-rw-r--r--src/include/mutex.h9
1 files changed, 5 insertions, 4 deletions
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