refactor
This commit is contained in:
		| @@ -138,8 +138,7 @@ void file_manager::close(std::uint64_t handle) { | |||||||
| void file_manager::close_all(const std::string &api_path) { | void file_manager::close_all(const std::string &api_path) { | ||||||
|   REPERTORY_USES_FUNCTION_NAME(); |   REPERTORY_USES_FUNCTION_NAME(); | ||||||
|  |  | ||||||
|   recur_mutex_lock file_lock(open_file_mtx_); |   unique_recur_mutex_lock file_lock(open_file_mtx_); | ||||||
|  |  | ||||||
|   auto file_iter = open_file_lookup_.find(api_path); |   auto file_iter = open_file_lookup_.find(api_path); | ||||||
|   if (file_iter == open_file_lookup_.end()) { |   if (file_iter == open_file_lookup_.end()) { | ||||||
|     return; |     return; | ||||||
| @@ -147,6 +146,7 @@ void file_manager::close_all(const std::string &api_path) { | |||||||
|  |  | ||||||
|   auto closeable_file = file_iter->second; |   auto closeable_file = file_iter->second; | ||||||
|   open_file_lookup_.erase(api_path); |   open_file_lookup_.erase(api_path); | ||||||
|  |   file_lock.unlock(); | ||||||
|  |  | ||||||
|   closeable_file->remove_all(); |   closeable_file->remove_all(); | ||||||
|   closeable_file.reset(); |   closeable_file.reset(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user