updated build system
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...

This commit is contained in:
2025-01-02 20:28:51 -06:00
parent 63b2d0e741
commit 754dfc49db
2 changed files with 6 additions and 5 deletions

View File

@ -93,7 +93,7 @@ private:
fs_file_t file_;
private:
mutable std::vector<io_item *> actions_;
mutable std::vector<std::shared_ptr<io_item>> actions_;
mutable std::unique_ptr<std::thread> io_thread_;
mutable std::unique_ptr<std::mutex> mtx_{std::make_unique<std::mutex>()};
mutable std::unique_ptr<std::condition_variable> notify_{

View File

@ -20,6 +20,7 @@
SOFTWARE.
*/
#include "utils/file_thread_file.hpp"
#include <memory>
namespace repertory::utils::file {
// auto thread_file::attach_file(native_handle handle,
@ -104,14 +105,14 @@ auto thread_file::do_io(action_t action) const -> bool {
io_thread_ = std::make_unique<std::thread>([this]() { thread_func(); });
}
io_item item{action};
actions_.emplace_back(&item);
auto item = std::make_shared<io_item>(action);
actions_.emplace_back(item);
notify_->notify_all();
lock.unlock();
item.wait();
item->wait();
return item.success;
return item->success;
}
void thread_file::flush() const {