fixes
This commit is contained in:
parent
ad79c5daf5
commit
9bfdece859
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "file_manager/open_file_base.hpp"
|
#include "file_manager/open_file_base.hpp"
|
||||||
|
|
||||||
|
#include "events/event_system.hpp"
|
||||||
#include "file_manager/events.hpp"
|
#include "file_manager/events.hpp"
|
||||||
#include "providers/i_provider.hpp"
|
#include "providers/i_provider.hpp"
|
||||||
#include "utils/path.hpp"
|
#include "utils/path.hpp"
|
||||||
|
@ -103,7 +103,7 @@ ring_buffer_open_file::~ring_buffer_open_file() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r::ring_buffer_open_file::download_chunk(std::size_t chunk) -> api_error {
|
auto ring_buffer_open_file::download_chunk(std::size_t chunk) -> api_error {
|
||||||
unique_mutex_lock chunk_lock(chunk_mtx_);
|
unique_mutex_lock chunk_lock(chunk_mtx_);
|
||||||
if (active_downloads_.find(chunk) != active_downloads_.end()) {
|
if (active_downloads_.find(chunk) != active_downloads_.end()) {
|
||||||
auto active_download = active_downloads_.at(chunk);
|
auto active_download = active_downloads_.at(chunk);
|
||||||
|
@ -21,34 +21,33 @@
|
|||||||
*/
|
*/
|
||||||
#include "file_manager/upload.hpp"
|
#include "file_manager/upload.hpp"
|
||||||
|
|
||||||
#include "platform/platform.hpp"
|
#include "events/event_system.hpp"
|
||||||
|
#include "file_manager/events.hpp"
|
||||||
#include "providers/i_provider.hpp"
|
#include "providers/i_provider.hpp"
|
||||||
#include "utils/error_utils.hpp"
|
#include "utils/error_utils.hpp"
|
||||||
#include "utils/file_utils.hpp"
|
#include "utils/file_utils.hpp"
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
using std::bind;
|
upload::upload(filesystem_item fsi, i_provider &provider)
|
||||||
|
|
||||||
file_manager::upload::upload(filesystem_item fsi, i_provider &provider)
|
|
||||||
: fsi_(std::move(fsi)), provider_(provider) {
|
: fsi_(std::move(fsi)), provider_(provider) {
|
||||||
thread_ = std::make_unique<std::thread>([this] { upload_thread(); });
|
thread_ = std::make_unique<std::thread>([this] { upload_thread(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
file_manager::upload::~upload() {
|
upload::~upload() {
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
thread_->join();
|
thread_->join();
|
||||||
thread_.reset();
|
thread_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_manager::upload::cancel() {
|
void upload::cancel() {
|
||||||
cancelled_ = true;
|
cancelled_ = true;
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_manager::upload::stop() { stop_requested_ = true; }
|
void upload::stop() { stop_requested_ = true; }
|
||||||
|
|
||||||
void file_manager::upload::upload_thread() {
|
void upload::upload_thread() {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
error_ =
|
error_ =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user