Hold checkpoint_safe lock when setting callback, clear callback at end of test.

git-svn-id: file:///svn/toku/tokudb@11320 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Barry Perlman 2013-04-16 23:57:49 -04:00 committed by Yoni Fogel
parent 51ba43f193
commit 4784ac1f0b
2 changed files with 4 additions and 1 deletions

View file

@ -327,7 +327,8 @@ test_main (int argc, const char *argv[]) {
}
db_env_set_checkpoint_callback(checkpoint_callback, (void*) test_dictionary);
runtests(0,4,1);
runtests(0,4096,1);
db_env_set_checkpoint_callback(NULL, NULL);
return 0;
}

View file

@ -3818,6 +3818,8 @@ void setup_dlmalloc (void) {
// For test purposes only.
// With this interface, all checkpoint users get the same callback and the same extra.
void db_env_set_checkpoint_callback (void (*callback_f)(void*), void* extra) {
toku_checkpoint_safe_client_lock();
checkpoint_callback_f = callback_f;
checkpoint_callback_extra = extra;
toku_checkpoint_safe_client_unlock();
}