Now used IThread to start threads, cpu-affinity broken, nonce allocation in double mode probably broken too.

This commit is contained in:
XMRig 2018-04-02 15:03:56 +07:00
parent 6c970612bf
commit 72cd6d168e
8 changed files with 47 additions and 38 deletions

View file

@ -4,8 +4,8 @@
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2016-2017 XMRig <support@xmrig.com>
*
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,30 +29,30 @@
#include <uv.h>
#include "interfaces/IThread.h"
class IWorker;
class Handle
{
public:
Handle(int threadId, int threads, int64_t affinity, int priority);
Handle(xmrig::IThread *config, size_t totalWays);
void join();
void start(void (*callback) (void *));
inline int priority() const { return m_priority; }
inline int threadId() const { return m_threadId; }
inline int threads() const { return m_threads; }
inline int64_t affinity() const { return m_affinity; }
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 void setWorker(IWorker *worker) { m_worker = worker; }
inline xmrig::IThread *config() const { return m_config; }
private:
int m_priority;
int m_threadId;
int m_threads;
int64_t m_affinity;
IWorker *m_worker;
size_t m_totalWays;
uv_thread_t m_thread;
xmrig::IThread *m_config;
};