File tree Expand file tree Collapse file tree 4 files changed +3
-12
lines changed Expand file tree Collapse file tree 4 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -204,19 +204,11 @@ fil_validate_skip(void)
204
204
/* ===================*/
205
205
{
206
206
/* * The fil_validate() call skip counter. */
207
- static int fil_validate_count = FIL_VALIDATE_SKIP ;
207
+ static Atomic_counter< uint32_t > fil_validate_count;
208
208
209
209
/* We want to reduce the call frequency of the costly fil_validate()
210
210
check in debug builds. */
211
- int count = my_atomic_add32_explicit (&fil_validate_count, -1 ,
212
- MY_MEMORY_ORDER_RELAXED);
213
- if (count > 0 ) {
214
- return (true );
215
- }
216
-
217
- my_atomic_store32_explicit (&fil_validate_count, FIL_VALIDATE_SKIP,
218
- MY_MEMORY_ORDER_RELAXED);
219
- return (fil_validate ());
211
+ return (fil_validate_count++ % FIL_VALIDATE_SKIP) || fil_validate ();
220
212
}
221
213
#endif /* UNIV_DEBUG */
222
214
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ Created 1/8/1996 Heikki Tuuri
31
31
#include " data0data.h"
32
32
#include " dict0mem.h"
33
33
#include " fsp0fsp.h"
34
- #include < atomic>
35
34
#include < deque>
36
35
37
36
extern bool innodb_table_stats_not_found;
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ used throughout InnoDB but do not include too much themselves. They
83
83
support cross-platform development and expose comonly used SQL names. */
84
84
85
85
#include < my_global.h>
86
+ #include " my_counter.h"
86
87
87
88
/* JAN: TODO: missing 5.7 header */
88
89
#ifdef HAVE_MY_THREAD_H
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ Created 2012/04/12 by Sunny Bains
29
29
#define ut0counter_h
30
30
31
31
#include " os0thread.h"
32
- #include < atomic>
33
32
#include " my_rdtsc.h"
34
33
35
34
/* * CPU cache line size */
You can’t perform that action at this time.
0 commit comments