File tree Expand file tree Collapse file tree 3 files changed +33
-29
lines changed Expand file tree Collapse file tree 3 files changed +33
-29
lines changed Original file line number Diff line number Diff line change 9
9
10
10
#include < functional>
11
11
#include < memory>
12
- #include < mutex>
13
12
#include < optional>
14
13
#include < string>
15
14
#include < vector>
Original file line number Diff line number Diff line change @@ -276,11 +276,6 @@ namespace mamba
276
276
277
277
using ConsoleBuffer = std::vector<std::string>;
278
278
279
- struct ConsoleSynchedData
280
- {
281
- std::unique_ptr<ProgressBarManager> progress_bar_manager;
282
- ConsoleBuffer buffer;
283
- };
284
279
285
280
class ConsoleData
286
281
{
@@ -297,15 +292,20 @@ namespace mamba
297
292
ConsoleData (ConsoleData&&) noexcept = delete ;
298
293
ConsoleData& operator =(ConsoleData&&) noexcept = delete ;
299
294
295
+
300
296
const Context& m_context;
301
297
302
298
std::string json_hier;
303
299
unsigned int json_index = 0 ;
304
300
nlohmann::json json_log;
305
301
bool is_json_print_cancelled = false ;
306
302
307
-
308
- util::synchronized_value<ConsoleSynchedData> m_synched_data;
303
+ struct Data
304
+ {
305
+ std::unique_ptr<ProgressBarManager> progress_bar_manager;
306
+ ConsoleBuffer buffer;
307
+ };
308
+ util::synchronized_value<Data> m_synched_data;
309
309
310
310
TaskSynchronizer m_tasksync;
311
311
};
Original file line number Diff line number Diff line change @@ -1065,26 +1065,7 @@ namespace mamba
1065
1065
#pragma GCC diagnostic pop
1066
1066
#endif
1067
1067
1068
- struct LockedFilesData
1069
- {
1070
- // TODO: replace by something like boost::multiindex or equivalent to avoid having to
1071
- // handle 2 hashmaps
1072
- std::unordered_map<fs::u8path, std::weak_ptr<LockFileOwner>> locked_files; // TODO:
1073
- // consider
1074
- // replacing
1075
- // by real
1076
- // concurrent
1077
- // set to
1078
- // avoid
1079
- // having to
1080
- // lock the
1081
- // whole
1082
- // container
1083
-
1084
- std::unordered_map<int , fs::u8path> fd_to_locked_path; // this is a workaround the
1085
- // usage of file descriptors on
1086
- // linux instead of paths
1087
- };
1068
+
1088
1069
1089
1070
class LockedFilesRegistry
1090
1071
{
@@ -1188,7 +1169,31 @@ namespace mamba
1188
1169
std::atomic_bool m_is_file_locking_allowed{ true };
1189
1170
std::atomic<std::chrono::seconds> m_default_lock_timeout{ std::chrono::seconds::zero () };
1190
1171
1191
- util::synchronized_value<LockedFilesData, std::recursive_mutex> m_data;
1172
+ struct Data
1173
+ {
1174
+ // TODO: replace by something like boost::multiindex or equivalent to avoid having
1175
+ // to handle 2 hashmaps
1176
+ std::unordered_map<fs::u8path, std::weak_ptr<LockFileOwner>> locked_files; // TODO:
1177
+ // consider
1178
+ // replacing
1179
+ // by
1180
+ // real
1181
+ // concurrent
1182
+ // set
1183
+ // to
1184
+ // avoid
1185
+ // having
1186
+ // to
1187
+ // lock
1188
+ // the
1189
+ // whole
1190
+ // container
1191
+
1192
+ std::unordered_map<int , fs::u8path> fd_to_locked_path; // this is a workaround the
1193
+ // usage of file descriptors
1194
+ // on linux instead of paths
1195
+ };
1196
+ util::synchronized_value<Data, std::recursive_mutex> m_data;
1192
1197
};
1193
1198
1194
1199
static LockedFilesRegistry files_locked_by_this_process;
You can’t perform that action at this time.
0 commit comments