diff --git src/import_manager.cc src/import_manager.cc
index 7d7d9ade..db1caf9e 100644
|
|
|
3 | 3 | bool ImportManager::IsInitialImport(const std::string& path) { |
4 | 4 | // Try reading the value |
5 | 5 | { |
6 | | std::shared_lock<std::shared_timed_mutex> lock(initial_import_mutex_); |
| 6 | std::lock_guard<std::mutex> lock(initial_import_mutex_); |
7 | 7 | if (initial_import_.find(path) != initial_import_.end()) |
8 | 8 | return false; |
9 | 9 | } |
10 | 10 | |
11 | 11 | // Try inserting the value |
12 | 12 | { |
13 | | std::unique_lock<std::shared_timed_mutex> lock(initial_import_mutex_); |
| 13 | std::unique_lock<std::mutex> lock(initial_import_mutex_); |
14 | 14 | return initial_import_.insert(path).second; |
15 | 15 | } |
16 | 16 | } |
… |
… |
bool ImportManager::IsInitialImport(const std::string& path) { |
18 | 18 | bool ImportManager::TryMarkDependencyImported(const std::string& path) { |
19 | 19 | // Try reading the value |
20 | 20 | { |
21 | | std::shared_lock<std::shared_timed_mutex> lock(dependency_mutex_); |
| 21 | std::lock_guard<std::mutex> lock(dependency_mutex_); |
22 | 22 | if (dependency_imported_.find(path) != dependency_imported_.end()) |
23 | 23 | return false; |
24 | 24 | } |
25 | 25 | |
26 | 26 | // Try inserting the value |
27 | 27 | { |
28 | | std::unique_lock<std::shared_timed_mutex> lock(dependency_mutex_); |
| 28 | std::unique_lock<std::mutex> lock(dependency_mutex_); |
29 | 29 | return dependency_imported_.insert(path).second; |
30 | 30 | } |
31 | 31 | } |
diff --git src/import_manager.h src/import_manager.h
index 07fe6272..f00c7141 100644
|
|
|
1 | 1 | #pragma once |
2 | 2 | |
3 | | #include <shared_mutex> |
| 3 | #include <mutex> |
4 | 4 | #include <string> |
5 | 5 | #include <unordered_set> |
6 | 6 | |
… |
… |
struct ImportManager { |
27 | 27 | std::unordered_set<std::string> querydb_processing_; |
28 | 28 | |
29 | 29 | // TODO: use shared_mutex |
30 | | std::shared_timed_mutex dependency_mutex_; |
| 30 | std::mutex dependency_mutex_; |
31 | 31 | std::unordered_set<std::string> dependency_imported_; |
32 | 32 | |
33 | 33 | // TODO: use shared_mutex |
34 | | std::shared_timed_mutex initial_import_mutex_; |
| 34 | std::mutex initial_import_mutex_; |
35 | 35 | std::unordered_set<std::string> initial_import_; |
36 | | }; |
37 | | No newline at end of file |
| 36 | }; |