MDEV-24333 Data race in os_file_pread at os/os0file.cc:3308 on os_n_file_reads

os_n_file_reads: make Atomic_counter and correct the semantics of an imprecise
counter.

Reviewed by: Marko Mäkelä
This commit is contained in:
Eugene Kosov 2020-12-02 09:58:50 +03:00
commit fccd810404
2 changed files with 5 additions and 3 deletions

View file

@ -45,6 +45,8 @@ Created 10/21/1995 Heikki Tuuri
#include <time.h>
#endif /* !_WIN32 */
#include "my_counter.h"
/** File node of a tablespace or the log data space */
struct fil_node_t;
struct fil_space_t;
@ -460,7 +462,7 @@ or write, causing a bottleneck for parallelism. */
static const ulint OS_AIO_SYNC = 24;
/* @} */
extern ulint os_n_file_reads;
extern Atomic_counter<ulint> os_n_file_reads;
extern ulint os_n_file_writes;
extern ulint os_n_fsyncs;