Removed no longer required code.

This commit is contained in:
XMRig 2019-07-12 02:25:07 +07:00
parent 6f27037f07
commit be7ff62c48
5 changed files with 3 additions and 16 deletions

View file

@ -26,10 +26,8 @@
#include "workers/ThreadHandle.h" #include "workers/ThreadHandle.h"
ThreadHandle::ThreadHandle(xmrig::IThread *config, uint32_t offset, size_t totalWays) : ThreadHandle::ThreadHandle(xmrig::IThread *config) :
m_worker(nullptr), m_worker(nullptr),
m_totalWays(totalWays),
m_offset(offset),
m_config(config) m_config(config)
{ {
} }

View file

@ -40,21 +40,17 @@ class IWorker;
class ThreadHandle class ThreadHandle
{ {
public: public:
ThreadHandle(xmrig::IThread *config, uint32_t offset, size_t totalWays); ThreadHandle(xmrig::IThread *config);
void join(); void join();
void start(void (*callback) (void *)); void start(void (*callback) (void *));
inline IWorker *worker() const { return m_worker; } inline IWorker *worker() const { return m_worker; }
inline size_t threadId() const { return m_config->index(); } 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 void setWorker(IWorker *worker) { assert(worker != nullptr); m_worker = worker; }
inline xmrig::IThread *config() const { return m_config; } inline xmrig::IThread *config() const { return m_config; }
private: private:
IWorker *m_worker; IWorker *m_worker;
size_t m_totalWays;
uint32_t m_offset;
uv_thread_t m_thread; uv_thread_t m_thread;
xmrig::IThread *m_config; xmrig::IThread *m_config;
}; };

View file

@ -35,8 +35,6 @@
Worker::Worker(ThreadHandle *handle) : Worker::Worker(ThreadHandle *handle) :
m_id(handle->threadId()), m_id(handle->threadId()),
m_totalWays(handle->totalWays()),
m_offset(handle->offset()),
m_hashCount(0), m_hashCount(0),
m_timestamp(0), m_timestamp(0),
m_count(0), m_count(0),

View file

@ -57,8 +57,6 @@ protected:
void storeStats(); void storeStats();
const size_t m_id; const size_t m_id;
const size_t m_totalWays;
const uint32_t m_offset;
MemInfo m_memory; MemInfo m_memory;
std::atomic<uint64_t> m_hashCount; std::atomic<uint64_t> m_hashCount;
std::atomic<uint64_t> m_timestamp; std::atomic<uint64_t> m_timestamp;

View file

@ -200,11 +200,8 @@ void Workers::start(xmrig::Controller *controller)
uv_timer_init(uv_default_loop(), m_timer); uv_timer_init(uv_default_loop(), m_timer);
uv_timer_start(m_timer, Workers::onTick, 500, 500); uv_timer_start(m_timer, Workers::onTick, 500, 500);
uint32_t offset = 0;
for (xmrig::IThread *thread : threads) { for (xmrig::IThread *thread : threads) {
ThreadHandle *handle = new ThreadHandle(thread, offset, m_status.ways); ThreadHandle *handle = new ThreadHandle(thread);
offset += thread->multiway();
m_workers.push_back(handle); m_workers.push_back(handle);
handle->start(Workers::onReady); handle->start(Workers::onReady);