Skip to content

Commit

Permalink
fix member variable initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
lqxhub committed Jun 19, 2023
1 parent 4f5314e commit 23ff105
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/storage/include/storage/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -1027,21 +1027,21 @@ class Storage {
std::unique_ptr<RedisSets> sets_db_;
std::unique_ptr<RedisZSets> zsets_db_;
std::unique_ptr<RedisLists> lists_db_;
std::atomic<bool> is_opened_;
std::atomic<bool> is_opened_ = false;

std::unique_ptr<LRUCache<std::string, std::string>> cursors_store_;

// Storage start the background thread for compaction task
pthread_t bg_tasks_thread_id_;
pthread_t bg_tasks_thread_id_ = 0;
pstd::Mutex bg_tasks_mutex_;
pstd::CondVar bg_tasks_cond_var_;
std::queue<BGTask> bg_tasks_queue_;

std::atomic<int> current_task_type_;
std::atomic<bool> bg_tasks_should_exit_;
std::atomic<int> current_task_type_ = kNone;
std::atomic<bool> bg_tasks_should_exit_ = false;

// For scan keys in data base
std::atomic<bool> scan_keynum_exit_;
std::atomic<bool> scan_keynum_exit_ = false;
};

} // namespace storage
Expand Down
3 changes: 1 addition & 2 deletions src/storage/src/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ Status StorageOptions::ResetOptions(const OptionType& option_type,
return Status::OK();
}

Storage::Storage()
: is_opened_(false), current_task_type_(kNone), bg_tasks_should_exit_(false), scan_keynum_exit_(false) {
Storage::Storage() {
cursors_store_ = std::make_unique<LRUCache<std::string, std::string>>();
cursors_store_->SetCapacity(5000);

Expand Down

0 comments on commit 23ff105

Please sign in to comment.