This commit is contained in:
parent
8bb179c4dd
commit
57d583d6b5
@ -69,6 +69,7 @@ public:
|
|||||||
get_read_state(std::size_t /* chunk */) const -> bool override {
|
get_read_state(std::size_t /* chunk */) const -> bool override {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] auto get_total_chunks() const -> std::uint64_t {
|
[[nodiscard]] auto get_total_chunks() const -> std::uint64_t {
|
||||||
return total_chunks_;
|
return total_chunks_;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] virtual auto can_close() const -> bool = 0;
|
[[nodiscard]] virtual auto can_close() const -> bool = 0;
|
||||||
|
|
||||||
virtual void close() = 0;
|
virtual auto close() -> bool = 0;
|
||||||
|
|
||||||
[[nodiscard]] virtual auto
|
[[nodiscard]] virtual auto
|
||||||
get_handles() const -> std::vector<std::uint64_t> = 0;
|
get_handles() const -> std::vector<std::uint64_t> = 0;
|
||||||
|
@ -90,7 +90,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void close() override;
|
auto close() -> bool override;
|
||||||
|
|
||||||
[[nodiscard]] auto get_read_state() const -> boost::dynamic_bitset<> override;
|
[[nodiscard]] auto get_read_state() const -> boost::dynamic_bitset<> override;
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] auto can_close() const -> bool override;
|
[[nodiscard]] auto can_close() const -> bool override;
|
||||||
|
|
||||||
void close() override;
|
auto close() -> bool override;
|
||||||
|
|
||||||
[[nodiscard]] auto get_api_error() const -> api_error;
|
[[nodiscard]] auto get_api_error() const -> api_error;
|
||||||
|
|
||||||
|
@ -297,12 +297,12 @@ void open_file_base::set_api_path(const std::string &api_path) {
|
|||||||
fsi_.api_parent = utils::path::get_parent_api_path(api_path);
|
fsi_.api_parent = utils::path::get_parent_api_path(api_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void open_file_base::close() {
|
auto open_file_base::close() -> bool {
|
||||||
unique_mutex_lock io_lock(io_thread_mtx_);
|
unique_mutex_lock io_lock(io_thread_mtx_);
|
||||||
if (io_stop_requested_ || not io_thread_) {
|
if (io_stop_requested_ || not io_thread_) {
|
||||||
io_thread_notify_.notify_all();
|
io_thread_notify_.notify_all();
|
||||||
io_lock.unlock();
|
io_lock.unlock();
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
io_stop_requested_ = true;
|
io_stop_requested_ = true;
|
||||||
@ -311,5 +311,7 @@ void open_file_base::close() {
|
|||||||
|
|
||||||
io_thread_->join();
|
io_thread_->join();
|
||||||
io_thread_.reset();
|
io_thread_.reset();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user