diff --git a/src/lockpool.cpp b/src/lockpool.cpp index b669b86..a1292fa 100644 --- a/src/lockpool.cpp +++ b/src/lockpool.cpp @@ -42,9 +42,15 @@ namespace detail { namespace { -// This seems to be the maximum across all modern CPUs +// Cache line size, in bytes // NOTE: This constant is made as a macro because some compilers (gcc 4.4 for one) don't allow enums or namespace scope constants in alignment attributes +#if defined(__s390__) || defined(__s390x__) +#define BOOST_ATOMIC_CACHE_LINE_SIZE 256 +#elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__) +#define BOOST_ATOMIC_CACHE_LINE_SIZE 128 +#else #define BOOST_ATOMIC_CACHE_LINE_SIZE 64 +#endif #if defined(BOOST_ATOMIC_USE_PTHREAD) typedef pthread_mutex_t lock_type;