Skip to content

Commit 4ef481f

Browse files
committed
MDEV-17441 - InnoDB transition to C++11 atomics
os_aio_validate_count transition to Atomic_counter.
1 parent dbd40ed commit 4ef481f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

storage/innobase/os/os0file.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,15 +1084,8 @@ os_aio_validate_skip()
10841084
/** Try os_aio_validate() every this many times */
10851085
# define OS_AIO_VALIDATE_SKIP 13
10861086

1087-
static int os_aio_validate_count;
1088-
1089-
if (my_atomic_add32_explicit(&os_aio_validate_count, -1,
1090-
MY_MEMORY_ORDER_RELAXED)
1091-
% OS_AIO_VALIDATE_SKIP) {
1092-
return true;
1093-
}
1094-
1095-
return(os_aio_validate());
1087+
static Atomic_counter<uint32_t> os_aio_validate_count;
1088+
return (os_aio_validate_count++ % OS_AIO_VALIDATE_SKIP) || os_aio_validate();
10961089
}
10971090
#endif /* UNIV_DEBUG */
10981091

0 commit comments

Comments
 (0)