From 543081e4a198386a7208d0fe63411c149c4e36f5 Mon Sep 17 00:00:00 2001 From: Chloe Marcec Date: Thu, 9 Sep 2021 00:10:52 +1000 Subject: [PATCH] Mark is_complete as atomic --- src/core/hle/service/acc/async_context.cpp | 6 +++--- src/core/hle/service/acc/async_context.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/hle/service/acc/async_context.cpp b/src/core/hle/service/acc/async_context.cpp index f7a7e34eac..4593231327 100644 --- a/src/core/hle/service/acc/async_context.cpp +++ b/src/core/hle/service/acc/async_context.cpp @@ -46,11 +46,11 @@ void IAsyncContext::Cancel(Kernel::HLERequestContext& ctx) { void IAsyncContext::HasDone(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_ACC, "called"); - is_complete = IsComplete(); + is_complete.store(IsComplete()); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); - rb.Push(is_complete); + rb.Push(is_complete.load()); } void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) { @@ -61,7 +61,7 @@ void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) { } void IAsyncContext::MarkComplete() { - is_complete = true; + is_complete.store(true); compeletion_event.GetWritableEvent().Signal(); } diff --git a/src/core/hle/service/acc/async_context.h b/src/core/hle/service/acc/async_context.h index 6592326d08..c694b4946b 100644 --- a/src/core/hle/service/acc/async_context.h +++ b/src/core/hle/service/acc/async_context.h @@ -4,6 +4,7 @@ #pragma once +#include #include "core/hle/kernel/k_event.h" #include "core/hle/service/service.h" @@ -29,7 +30,7 @@ protected: void MarkComplete(); - bool is_complete{false}; + std::atomic is_complete{false}; Kernel::KEvent compeletion_event; };