summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-08-26 01:16:40 +0000
committerGravatar ReinUsesLisp2020-08-26 02:43:15 +0000
commitea7bda25ba99262267acaa179762c83e3e96a232 (patch)
treecb369d87aba010d75056786120b3ced3b9a8350a
parentMerge pull request #4572 from lioncash/xbyak (diff)
downloadyuzu-ea7bda25ba99262267acaa179762c83e3e96a232.tar.gz
yuzu-ea7bda25ba99262267acaa179762c83e3e96a232.tar.xz
yuzu-ea7bda25ba99262267acaa179762c83e3e96a232.zip
cpu_interrupt_handler: Make is_interrupted an atomic
Fixes a race condition detected from tsan
Diffstat (limited to '')
-rw-r--r--src/core/arm/cpu_interrupt_handler.cpp2
-rw-r--r--src/core/arm/cpu_interrupt_handler.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/arm/cpu_interrupt_handler.cpp b/src/core/arm/cpu_interrupt_handler.cpp
index df0350881..4c717ebe9 100644
--- a/src/core/arm/cpu_interrupt_handler.cpp
+++ b/src/core/arm/cpu_interrupt_handler.cpp
@@ -7,7 +7,7 @@
7 7
8namespace Core { 8namespace Core {
9 9
10CPUInterruptHandler::CPUInterruptHandler() : is_interrupted{} { 10CPUInterruptHandler::CPUInterruptHandler() {
11 interrupt_event = std::make_unique<Common::Event>(); 11 interrupt_event = std::make_unique<Common::Event>();
12} 12}
13 13
diff --git a/src/core/arm/cpu_interrupt_handler.h b/src/core/arm/cpu_interrupt_handler.h
index 3d062d326..61c22fef9 100644
--- a/src/core/arm/cpu_interrupt_handler.h
+++ b/src/core/arm/cpu_interrupt_handler.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <atomic>
7#include <memory> 8#include <memory>
8 9
9namespace Common { 10namespace Common {
@@ -32,7 +33,7 @@ public:
32 void AwaitInterrupt(); 33 void AwaitInterrupt();
33 34
34private: 35private:
35 bool is_interrupted{}; 36 std::atomic_bool is_interrupted{false};
36 std::unique_ptr<Common::Event> interrupt_event; 37 std::unique_ptr<Common::Event> interrupt_event;
37}; 38};
38 39