Fixed pool lock

This commit is contained in:
SChernykh 2020-04-07 18:48:02 +02:00
parent 69cbfd682a
commit 4d0edde66d

View file

@ -406,6 +406,8 @@ extern "C" {
randomx_vm* vm = nullptr;
std::lock_guard<std::mutex> lock(vm_pool_mutex);
static uint8_t* vm_pool[64] = {};
static size_t vm_pool_offset[64] = {};
@ -415,8 +417,6 @@ extern "C" {
node = 0;
}
std::lock_guard<std::mutex> lock(vm_pool_mutex);
if (!vm_pool[node]) {
vm_pool[node] = (uint8_t*) xmrig::VirtualMemory::allocateLargePagesMemory(VM_POOL_SIZE);
if (!vm_pool[node]) {