mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 11:42:33 +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:
+7
-2
@@ -59,12 +59,15 @@ public:
|
||||
enum state_type {
|
||||
STATE_UNKNOWN,
|
||||
STATE_INITIALIZED,
|
||||
STATE_ACTIVE
|
||||
STATE_ACTIVE,
|
||||
STATE_INACTIVE
|
||||
};
|
||||
|
||||
ThreadBase();
|
||||
virtual ~ThreadBase();
|
||||
|
||||
bool is_active() const { return m_state == STATE_ACTIVE; }
|
||||
|
||||
torrent::Poll* poll() { return m_pollManager->get_torrent_poll(); }
|
||||
core::PollManager* poll_manager() { return m_pollManager; }
|
||||
priority_queue& task_scheduler() { return m_taskScheduler; }
|
||||
@@ -72,7 +75,7 @@ public:
|
||||
virtual void init_thread() = 0;
|
||||
|
||||
void start_thread();
|
||||
void stop_thread();
|
||||
static void stop_thread(ThreadBase* thread);
|
||||
|
||||
// ATM, only interaction with a thread's allowed by other threads is
|
||||
// through the queue_item call.
|
||||
@@ -94,6 +97,8 @@ protected:
|
||||
core::PollManager* m_pollManager;
|
||||
rak::priority_queue_default m_taskScheduler;
|
||||
|
||||
rak::priority_item m_taskShutdown;
|
||||
|
||||
// Temporary hack to pass messages to a thread. This really needs to
|
||||
// be cleaned up and/or integrated into the priority queue itself.
|
||||
thread_queue_hack* m_threadQueue;
|
||||
|
||||
Reference in New Issue
Block a user