mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-26 14:02:53 -05:00
Fixed hashrate race condition
This commit is contained in:
@@ -215,6 +215,7 @@ void Workers::soft_stop() // stop current workers leaving uv stuff intact (used
|
||||
if (m_hashrate) {
|
||||
m_hashrate->stop();
|
||||
delete m_hashrate;
|
||||
m_hashrate = nullptr;
|
||||
}
|
||||
|
||||
m_sequence = 0;
|
||||
@@ -387,6 +388,8 @@ void Workers::onResult(uv_async_t *handle)
|
||||
|
||||
void Workers::onTick(uv_timer_t *handle)
|
||||
{
|
||||
if (m_hashrate == nullptr) return;
|
||||
|
||||
for (Handle *handle : m_workers) {
|
||||
if (!handle->worker()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user