From 01cdccb1cbdae47da51598184d84f6674bff971d Mon Sep 17 00:00:00 2001 From: ilho kim Date: Thu, 12 Oct 2023 15:49:04 +0900 Subject: [PATCH 1/1] Remove lock when getting the path of the database Since the memory database creation logic has been removed there is no need to hold the lock because only the path is returned when getting the database's path Change-Id: I255f74de540f64ef2d3b928664148639b14ef3a6 Signed-off-by: ilho kim --- src/server/database/db_handle_provider.cc | 3 --- src/server/database/db_handle_provider.hh | 1 - 2 files changed, 4 deletions(-) diff --git a/src/server/database/db_handle_provider.cc b/src/server/database/db_handle_provider.cc index 6f2b25e..626a88e 100644 --- a/src/server/database/db_handle_provider.cc +++ b/src/server/database/db_handle_provider.cc @@ -86,7 +86,6 @@ std::unordered_map> std::string DBHandleProvider::global_parser_filedb_path_; std::string DBHandleProvider::cert_filedb_path_; std::unordered_set DBHandleProvider::writer_pid_list_; -std::recursive_mutex DBHandleProvider::lock_; std::shared_mutex DBHandleProvider::pid_list_lock_; DBHandleProvider::DBHandleProvider(uid_t uid) : uid_(uid) { @@ -156,7 +155,6 @@ bool DBHandleProvider::IsCrashedWriteRequest() { } std::vector> DBHandleProvider::GetParserDBPath() { - std::unique_lock u(lock_); std::vector> db_path_list; if (uid_ > REGULAR_USER) @@ -180,7 +178,6 @@ std::string DBHandleProvider::GetCertDBPath() { } void DBHandleProvider::TrimCache() { - std::unique_lock u(lock_); if (!released_) ReleaseCache(); } diff --git a/src/server/database/db_handle_provider.hh b/src/server/database/db_handle_provider.hh index 6634917..e1a470b 100644 --- a/src/server/database/db_handle_provider.hh +++ b/src/server/database/db_handle_provider.hh @@ -83,7 +83,6 @@ class EXPORT_API DBHandleProvider { static std::string global_parser_filedb_path_; static std::string cert_filedb_path_; static std::unordered_set writer_pid_list_; - static std::recursive_mutex lock_; static std::shared_mutex pid_list_lock_; uid_t uid_; -- 2.7.4