mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 18:11:05 +00:00
#1180 Fixed race condition in nonce reset.
This commit is contained in:
parent
1cfd5f0735
commit
365667ee0a
2 changed files with 5 additions and 7 deletions
|
@ -124,16 +124,15 @@ public:
|
||||||
{
|
{
|
||||||
active = true;
|
active = true;
|
||||||
|
|
||||||
|
if (reset) {
|
||||||
|
Nonce::reset(job.index());
|
||||||
|
}
|
||||||
|
|
||||||
for (IBackend *backend : backends) {
|
for (IBackend *backend : backends) {
|
||||||
backend->setJob(job);
|
backend->setJob(job);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reset) {
|
|
||||||
Nonce::reset(job.index());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Nonce::touch();
|
Nonce::touch();
|
||||||
}
|
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
Nonce::pause(false);;
|
Nonce::pause(false);;
|
||||||
|
|
|
@ -78,7 +78,6 @@ void xmrig::Nonce::reset(uint8_t index)
|
||||||
std::lock_guard<std::mutex> lock(mutex);
|
std::lock_guard<std::mutex> lock(mutex);
|
||||||
|
|
||||||
m_nonces[index] = 0;
|
m_nonces[index] = 0;
|
||||||
touch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue