We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbd40ed commit 4ef481fCopy full SHA for 4ef481f
storage/innobase/os/os0file.cc
@@ -1084,15 +1084,8 @@ os_aio_validate_skip()
1084
/** Try os_aio_validate() every this many times */
1085
# define OS_AIO_VALIDATE_SKIP 13
1086
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());
+ static Atomic_counter<uint32_t> os_aio_validate_count;
+ return (os_aio_validate_count++ % OS_AIO_VALIDATE_SKIP) || os_aio_validate();
1096
}
1097
#endif /* UNIV_DEBUG */
1098
0 commit comments