mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 12:12:31 +00:00
* Added shutdown for worker thread.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1117 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -144,9 +144,18 @@ Control::cleanup_exception() {
|
||||
display::Canvas::cleanup();
|
||||
}
|
||||
|
||||
bool
|
||||
Control::is_shutdown_completed() {
|
||||
return m_shutdownQuick && !worker_thread->is_active() && torrent::is_inactive();
|
||||
}
|
||||
|
||||
void
|
||||
Control::handle_shutdown() {
|
||||
if (!m_shutdownQuick) {
|
||||
// Temporary hack:
|
||||
if (worker_thread->is_active())
|
||||
worker_thread->queue_item(&ThreadBase::stop_thread);
|
||||
|
||||
torrent::connection_manager()->listen_close();
|
||||
m_core->shutdown(false);
|
||||
|
||||
@@ -154,6 +163,10 @@ Control::handle_shutdown() {
|
||||
priority_queue_insert(&taskScheduler, &m_taskShutdown, cachedTime + rak::timer::from_seconds(5));
|
||||
|
||||
} else {
|
||||
// Temporary hack:
|
||||
if (worker_thread->is_active())
|
||||
worker_thread->queue_item(&ThreadBase::stop_thread);
|
||||
|
||||
m_core->shutdown(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user