diff --git a/src/include/port/atomics/generic-gcc.h b/src/include/port/atomics/generic-gcc.h index a3abc8a1a9..4e16098739 100644 --- a/src/include/port/atomics/generic-gcc.h +++ b/src/include/port/atomics/generic-gcc.h @@ -62,12 +62,15 @@ #define PG_HAVE_ATOMIC_FLAG_SUPPORT typedef struct pg_atomic_flag { - /* some platforms only have a 8 bit wide TAS */ -#ifdef HAVE_GCC__SYNC_CHAR_TAS - volatile char value; -#else - /* but an int works on more platforms */ + /* + * If we have a choice, use int-width TAS, because that is more efficient + * and/or more reliably implemented on most non-Intel platforms. (Note + * that this code isn't used on x86[_64]; see arch-x86.h for that.) + */ +#ifdef HAVE_GCC__SYNC_INT32_TAS volatile int value; +#else + volatile char value; #endif } pg_atomic_flag;