Remove lock when getting the path of the database 18/299918/1
authorilho kim <ilho159.kim@samsung.com>
Thu, 12 Oct 2023 06:49:04 +0000 (15:49 +0900)
committerilho kim <ilho159.kim@samsung.com>
Thu, 12 Oct 2023 06:49:04 +0000 (15:49 +0900)
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 <ilho159.kim@samsung.com>
src/server/database/db_handle_provider.cc
src/server/database/db_handle_provider.hh

index 6f2b25e..626a88e 100644 (file)
@@ -86,7 +86,6 @@ std::unordered_map<uid_t, std::unique_ptr<DBHandleProvider>>
 std::string DBHandleProvider::global_parser_filedb_path_;
 std::string DBHandleProvider::cert_filedb_path_;
 std::unordered_set<pid_t> 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<std::pair<std::string, uid_t>> DBHandleProvider::GetParserDBPath() {
-  std::unique_lock<std::recursive_mutex> u(lock_);
   std::vector<std::pair<std::string, uid_t>> db_path_list;
 
   if (uid_ > REGULAR_USER)
@@ -180,7 +178,6 @@ std::string DBHandleProvider::GetCertDBPath() {
 }
 
 void DBHandleProvider::TrimCache() {
-  std::unique_lock<std::recursive_mutex> u(lock_);
   if (!released_)
     ReleaseCache();
 }
index 6634917..e1a470b 100644 (file)
@@ -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<pid_t> writer_pid_list_;
-  static std::recursive_mutex lock_;
   static std::shared_mutex pid_list_lock_;
 
   uid_t uid_;