diff --git a/src/include/port/atomics/generic-gcc.h b/src/include/port/atomics/generic-gcc.h index d4cfd31bd193cdede8cfb6d50e321813ed034424..7efc0861e7157c6d7d27c20197336bcf16406b3e 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;