From 74e246feedf23f3b974f7bfd95d81c33222a633f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 23 Nov 2023 09:20:26 +0100 Subject: [PATCH] impr: Increase performance when updating task progress --- lib/libimhex/source/api/task_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libimhex/source/api/task_manager.cpp b/lib/libimhex/source/api/task_manager.cpp index 7f77c0fc6..fc21f188a 100644 --- a/lib/libimhex/source/api/task_manager.cpp +++ b/lib/libimhex/source/api/task_manager.cpp @@ -83,9 +83,9 @@ namespace hex { } void Task::update(u64 value) { - this->m_currValue = value; + this->m_currValue.store(value, std::memory_order_relaxed); - if (this->m_shouldInterrupt) [[unlikely]] + if (this->m_shouldInterrupt.load(std::memory_order_relaxed)) [[unlikely]] throw TaskInterruptor(); }