mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-06 22:29:23 +00:00
Use separate thread for saving session data.
This commit is contained in:
+8
-4
@@ -28,11 +28,11 @@
|
||||
#include "display/window.h"
|
||||
#include "display/manager.h"
|
||||
#include "input/bindings.h"
|
||||
#include "ui/root.h"
|
||||
|
||||
#include "rpc/command_scheduler.h"
|
||||
#include "rpc/command_scheduler_item.h"
|
||||
#include "rpc/parse_commands.h"
|
||||
#include "session/thread_session.h"
|
||||
#include "ui/root.h"
|
||||
#include "utils/directory.h"
|
||||
|
||||
#include "control.h"
|
||||
@@ -215,6 +215,8 @@ main(int argc, char** argv) {
|
||||
torrent::initialize();
|
||||
torrent::set_main_thread_slots(std::bind(&client_perform));
|
||||
|
||||
session::ThreadSession::create_thread();
|
||||
|
||||
// TODO: Move to controller.
|
||||
worker_thread = new ThreadWorker();
|
||||
worker_thread->init_thread();
|
||||
@@ -530,14 +532,16 @@ main(int argc, char** argv) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
torrent::log_cleanup();
|
||||
|
||||
delete control;
|
||||
control = nullptr;
|
||||
|
||||
session::ThreadSession::destroy_thread();
|
||||
|
||||
delete worker_thread;
|
||||
worker_thread = nullptr;
|
||||
|
||||
torrent::log_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user