mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
Moved code from ThreadBase to torrent::thread_base.
This commit is contained in:
+3
-7
@@ -54,16 +54,13 @@ class ThreadBase : public torrent::thread_base {
|
||||
public:
|
||||
typedef rak::priority_queue_default priority_queue;
|
||||
typedef void (*thread_base_func)(ThreadBase*);
|
||||
typedef void* (*pthread_func)(void*);
|
||||
|
||||
ThreadBase();
|
||||
virtual ~ThreadBase();
|
||||
|
||||
priority_queue& task_scheduler() { return m_taskScheduler; }
|
||||
|
||||
virtual void init_thread() = 0;
|
||||
|
||||
void start_thread();
|
||||
// Throw torrent::shutdown_exception to stop the thread.
|
||||
static void stop_thread(ThreadBase* thread);
|
||||
|
||||
// ATM, only interaction with a thread's allowed by other threads is
|
||||
@@ -71,8 +68,6 @@ public:
|
||||
|
||||
void queue_item(thread_base_func newFunc);
|
||||
|
||||
static void* event_loop(ThreadBase* thread);
|
||||
|
||||
// Only call this when global lock has been acquired, as it checks
|
||||
// ThreadBase::is_main_polling() which is only guaranteed to remain
|
||||
// 'false' if global lock keeps main thread from entering polling
|
||||
@@ -82,9 +77,10 @@ public:
|
||||
static void interrupt_main_polling();
|
||||
|
||||
protected:
|
||||
inline rak::timer client_next_timeout();
|
||||
int64_t next_timeout_usec();
|
||||
|
||||
void call_queued_items();
|
||||
virtual void call_events();
|
||||
|
||||
// TODO: Add thread name.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user