This commit is contained in:
parent
2952cc8373
commit
fd18ad9102
@ -35,14 +35,16 @@ void open_file_base::download::notify(const api_error &err) {
|
||||
}
|
||||
|
||||
auto open_file_base::download::wait() -> api_error {
|
||||
if (not complete_) {
|
||||
unique_mutex_lock lock(mtx_);
|
||||
if (not complete_) {
|
||||
notify_.wait(lock);
|
||||
}
|
||||
notify_.notify_all();
|
||||
if (complete_) {
|
||||
return error_;
|
||||
}
|
||||
|
||||
unique_mutex_lock lock(mtx_);
|
||||
if (not complete_) {
|
||||
notify_.wait(lock);
|
||||
}
|
||||
notify_.notify_all();
|
||||
|
||||
return error_;
|
||||
}
|
||||
|
||||
@ -195,7 +197,7 @@ auto open_file_base::get_filesystem_item() const -> filesystem_item {
|
||||
auto open_file_base::get_handles() const -> std::vector<std::uint64_t> {
|
||||
recur_mutex_lock file_lock(file_mtx_);
|
||||
std::vector<std::uint64_t> ret;
|
||||
for (auto &&item : open_data_) {
|
||||
for (const auto &item : open_data_) {
|
||||
ret.emplace_back(item.first);
|
||||
}
|
||||
|
||||
@ -261,7 +263,7 @@ void open_file_base::remove_all() {
|
||||
auto open_data = open_data_;
|
||||
open_data_.clear();
|
||||
|
||||
for (auto &&data : open_data) {
|
||||
for (const auto &data : open_data) {
|
||||
event_system::instance().raise<filesystem_item_handle_closed>(
|
||||
fsi_.api_path, data.first, fsi_.source_path, fsi_.directory, modified_);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user