Skip to content
Permalink
Browse files
MDEV-17441 - InnoDB transition to C++11 atomics
os_aio_validate_count transition to Atomic_counter.
  • Loading branch information
Sergey Vojtovich committed Dec 27, 2018
1 parent dbd40ed commit 4ef481f
Showing 1 changed file with 2 additions and 9 deletions.
@@ -1084,15 +1084,8 @@ os_aio_validate_skip()
/** Try os_aio_validate() every this many times */
# define OS_AIO_VALIDATE_SKIP 13

static int os_aio_validate_count;

if (my_atomic_add32_explicit(&os_aio_validate_count, -1,
MY_MEMORY_ORDER_RELAXED)
% OS_AIO_VALIDATE_SKIP) {
return true;
}

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();
}
#endif /* UNIV_DEBUG */

0 comments on commit 4ef481f

Please sign in to comment.