Commit 824e20e7 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Tell helgrind not to complain about the toku_checkpointing_user_status. Refs #2684. [t:2684]

git-svn-id: file:///svn/toku/tokudb@20879 c7de825b-a66e-492c-adef-691d508d4ae1
parent 26e68c87
......@@ -2176,8 +2176,14 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
// This is used by the cachetable_race test.
extern int toku_checkpointing_user_data_status __attribute__((__visibility__("default")));
int toku_checkpointing_user_data_status = 0;
extern int get_toku_checkpointing_user_data_status(void) __attribute__((__visibility__("default")));
static volatile int toku_checkpointing_user_data_status = 0;
static void set_toku_checkpointing_user_data_status (int v) {
toku_checkpointing_user_data_status = v;
}
int get_toku_checkpointing_user_data_status (void) {
return toku_checkpointing_user_data_status;
}
int
toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
......@@ -2217,9 +2223,9 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
assert(ct->lsn_of_checkpoint_in_progress.lsn >= cf->most_recent_global_checkpoint_that_finished_early.lsn);
cachetable_unlock(ct);
assert(cf->checkpoint_state == CS_CALLED_BEGIN_CHECKPOINT);
toku_checkpointing_user_data_status = 1;
set_toku_checkpointing_user_data_status(1);
int r = cf->checkpoint_userdata(cf, cf->fd, cf->userdata);
toku_checkpointing_user_data_status = 0;
set_toku_checkpointing_user_data_status(0);
assert(r==0);
cf->checkpoint_state = CS_CALLED_CHECKPOINT;
cachetable_lock(ct);
......
......@@ -75,7 +75,7 @@
toku_test_db_redirect_dictionary;
toku_test_get_latest_lsn;
toku_checkpointing_user_data_status;
get_toku_checkpointing_user_data_status;
local: *;
};
......
......@@ -32,7 +32,7 @@ enum {NUM_DBS=5};
char *free_me = NULL;
char *env_dir = ENVDIR; // the default env_dir.
static void run_test(void)
static void run_cachetable_race_test(void)
{
int r;
{
......@@ -71,11 +71,11 @@ static void run_test(void)
dbs[i] = NULL;
if (i==2) {
extern int toku_checkpointing_user_data_status;
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, toku_checkpointing_user_data_status);
while (toku_checkpointing_user_data_status==0)
extern int get_toku_checkpointing_user_data_status(void);
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, get_toku_checkpointing_user_data_status());
while (get_toku_checkpointing_user_data_status()==0)
sched_yield();
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, toku_checkpointing_user_data_status);
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, get_toku_checkpointing_user_data_status());
}
}
r = env->close(env, 0); CKERR(r);
......@@ -87,7 +87,7 @@ static void do_args(int argc, char * const argv[]);
int test_main(int argc, char * const *argv) {
do_args(argc, argv);
run_test();
run_cachetable_race_test();
if (free_me) toku_free(free_me);
return 0;
......
......@@ -3,3 +3,13 @@
Helgrind:Race
fun:mythread_wrapper
}
{
ignore_race_on_toku_checkpointing_user_data_status
Helgrind:Race
fun:set_toku_checkpointing_user_data_status.*
}
{
ignore_race_on_toku_checkpointing_user_data_status
Helgrind:Race
fun:get_toku_checkpointing_user_data_status
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment