From d5e7ab4985db228ab84c2c1b9a89dbd556fc1f8d Mon Sep 17 00:00:00 2001 From: SChernykh Date: Wed, 28 Aug 2019 18:28:04 +0200 Subject: [PATCH] Fixed race condition in RandomX thread init Thread could deadlock if it started before dataset struct was allocated. --- src/backend/cpu/CpuWorker.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/cpu/CpuWorker.cpp b/src/backend/cpu/CpuWorker.cpp index 0fc77f8d9..0abff909b 100644 --- a/src/backend/cpu/CpuWorker.cpp +++ b/src/backend/cpu/CpuWorker.cpp @@ -90,6 +90,8 @@ void xmrig::CpuWorker::allocateRandomX_VM() if (Nonce::sequence(Nonce::CPU) == 0) { return; } + + dataset = Rx::dataset(m_job.currentJob(), m_node); } if (!m_vm) {