From be7ff62c48adcf2644a48c3c494132bd13a913f9 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 12 Jul 2019 02:25:07 +0700 Subject: [PATCH] Removed no longer required code. --- src/workers/ThreadHandle.cpp | 4 +--- src/workers/ThreadHandle.h | 6 +----- src/workers/Worker.cpp | 2 -- src/workers/Worker.h | 2 -- src/workers/Workers.cpp | 5 +---- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/workers/ThreadHandle.cpp b/src/workers/ThreadHandle.cpp index 43ff950c..ced5f326 100644 --- a/src/workers/ThreadHandle.cpp +++ b/src/workers/ThreadHandle.cpp @@ -26,10 +26,8 @@ #include "workers/ThreadHandle.h" -ThreadHandle::ThreadHandle(xmrig::IThread *config, uint32_t offset, size_t totalWays) : +ThreadHandle::ThreadHandle(xmrig::IThread *config) : m_worker(nullptr), - m_totalWays(totalWays), - m_offset(offset), m_config(config) { } diff --git a/src/workers/ThreadHandle.h b/src/workers/ThreadHandle.h index f3e09ce5..c32aabf0 100644 --- a/src/workers/ThreadHandle.h +++ b/src/workers/ThreadHandle.h @@ -40,21 +40,17 @@ class IWorker; class ThreadHandle { public: - ThreadHandle(xmrig::IThread *config, uint32_t offset, size_t totalWays); + ThreadHandle(xmrig::IThread *config); void join(); void start(void (*callback) (void *)); inline IWorker *worker() const { return m_worker; } inline size_t threadId() const { return m_config->index(); } - inline size_t totalWays() const { return m_totalWays; } - inline uint32_t offset() const { return m_offset; } inline void setWorker(IWorker *worker) { assert(worker != nullptr); m_worker = worker; } inline xmrig::IThread *config() const { return m_config; } private: IWorker *m_worker; - size_t m_totalWays; - uint32_t m_offset; uv_thread_t m_thread; xmrig::IThread *m_config; }; diff --git a/src/workers/Worker.cpp b/src/workers/Worker.cpp index 0c61b3cb..3a9b693d 100644 --- a/src/workers/Worker.cpp +++ b/src/workers/Worker.cpp @@ -35,8 +35,6 @@ Worker::Worker(ThreadHandle *handle) : m_id(handle->threadId()), - m_totalWays(handle->totalWays()), - m_offset(handle->offset()), m_hashCount(0), m_timestamp(0), m_count(0), diff --git a/src/workers/Worker.h b/src/workers/Worker.h index 13e437d3..997771b0 100644 --- a/src/workers/Worker.h +++ b/src/workers/Worker.h @@ -57,8 +57,6 @@ protected: void storeStats(); const size_t m_id; - const size_t m_totalWays; - const uint32_t m_offset; MemInfo m_memory; std::atomic m_hashCount; std::atomic m_timestamp; diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 1ed27c40..72d9a1d1 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -200,11 +200,8 @@ void Workers::start(xmrig::Controller *controller) uv_timer_init(uv_default_loop(), m_timer); uv_timer_start(m_timer, Workers::onTick, 500, 500); - uint32_t offset = 0; - for (xmrig::IThread *thread : threads) { - ThreadHandle *handle = new ThreadHandle(thread, offset, m_status.ways); - offset += thread->multiway(); + ThreadHandle *handle = new ThreadHandle(thread); m_workers.push_back(handle); handle->start(Workers::onReady);