From a098207c958a03075f176fe0214e38a31579750a Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Tue, 21 Aug 2012 17:02:21 -0700 Subject: [PATCH] Fixed unit test c_test by initializing logger=NULL. Summary: Fixed unit test c_test by initializing logger=NULL. Removed "atomic" from last_log_ts so that unit tests do not require C11 compiler. Anyway, last_log_ts is mostly used for logging, so it is ok if it is loosely accurate. Test Plan: run c_test Reviewers: heyongqiang Reviewed By: heyongqiang Differential Revision: https://reviews.facebook.net/D4803 --- db/db_impl.cc | 3 ++- db/db_impl.h | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 1b5acb4bf..a133281ff 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -134,7 +134,8 @@ DBImpl::DBImpl(const Options& options, const std::string& dbname) log_(NULL), tmp_batch_(new WriteBatch), bg_compaction_scheduled_(false), - manual_compaction_(NULL) { + manual_compaction_(NULL), + logger_(NULL) { mem_->Ref(); has_imm_.Release_Store(NULL); diff --git a/db/db_impl.h b/db/db_impl.h index 509647ec5..e1e7578bc 100644 --- a/db/db_impl.h +++ b/db/db_impl.h @@ -7,7 +7,6 @@ #include #include -#include #include "db/dbformat.h" #include "db/log_writer.h" #include "db/snapshot.h" @@ -187,7 +186,7 @@ class DBImpl : public DB { StatsLogger* logger_; - std::atomic last_log_ts; + int64_t volatile last_log_ts; // Per level compaction stats. stats_[level] stores the stats for // compactions that produced data for the specified "level".