blob: 58248bd24781de4520b5f30266e0db5de728ca85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#pragma once
#include "miner_work.hpp"
#include "xmrstak/misc/environment.hpp"
#include <atomic>
namespace xmrstak
{
struct GlobalStates
{
static inline GlobalStates& inst()
{
auto& env = Environment::inst();
if(env.pGlobalStates == nullptr)
env.pGlobalStates = new GlobalStates;
return *env.pGlobalStates;
}
void switch_work(miner_work& pWork);
miner_work oGlobalWork;
std::atomic<uint64_t> iGlobalJobNo;
std::atomic<uint64_t> iConsumeCnt;
uint64_t iThreadCount;
private:
GlobalStates() : iThreadCount(0)
{
}
};
} // namepsace xmrstak
|