MDEV-12534 Use atomic operations whenever available

Allow 64-bit atomic operations on 32-bit systems,
only relying on HAVE_ATOMIC_BUILTINS_64, disregarding
the width of the register file.

Define UNIV_WORD_SIZE correctly on all systems, including Windows.
In MariaDB 10.0 and 10.1, it was incorrectly defined as 4 on
64-bit Windows.

Define HAVE_ATOMIC_BUILTINS_64 on Windows
(64-bit atomics are available on both 32-bit and 64-bit Windows
platforms; the operations were unnecessarily disabled even on
64-bit Windows).

MONITOR_OS_PENDING_READS, MONITOR_OS_PENDING_WRITES: Enable by default.

os_file_n_pending_preads, os_file_n_pending_pwrites,
os_n_pending_reads, os_n_pending_writes: Remove.
Use the monitor counters instead.

os_file_count_mutex: Remove. On a system that does not support
64-bit atomics, monitor_mutex will be used instead.
This commit is contained in:
Marko Mäkelä 2017-04-19 22:30:18 +03:00
commit d34a67b067
18 changed files with 216 additions and 407 deletions

View file

@ -667,10 +667,7 @@ os_atomic_clear(volatile lock_word_t* ptr)
# define HAVE_ATOMIC_BUILTINS
# define HAVE_ATOMIC_BUILTINS_BYTE
# ifndef _WIN32
# define HAVE_ATOMIC_BUILTINS_64
# endif
# define HAVE_ATOMIC_BUILTINS_64
/**********************************************************//**
Atomic compare and exchange of signed integers (both 32 and 64 bit).