Browse Source
Merge pull request #4586 from yuzu-emu/tsan-cpu-interrupt
cpu_interrupt_handler: Make is_interrupted an atomic
pull/15/merge
bunnei
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
5 deletions
-
src/core/arm/cpu_interrupt_handler.cpp
-
src/core/arm/cpu_interrupt_handler.h
|
|
|
@ -7,9 +7,7 @@ |
|
|
|
|
|
|
|
namespace Core { |
|
|
|
|
|
|
|
CPUInterruptHandler::CPUInterruptHandler() : is_interrupted{} { |
|
|
|
interrupt_event = std::make_unique<Common::Event>(); |
|
|
|
} |
|
|
|
CPUInterruptHandler::CPUInterruptHandler() : interrupt_event{std::make_unique<Common::Event>()} {} |
|
|
|
|
|
|
|
CPUInterruptHandler::~CPUInterruptHandler() = default; |
|
|
|
|
|
|
|
@ -17,7 +15,7 @@ void CPUInterruptHandler::SetInterrupt(bool is_interrupted_) { |
|
|
|
if (is_interrupted_) { |
|
|
|
interrupt_event->Set(); |
|
|
|
} |
|
|
|
this->is_interrupted = is_interrupted_; |
|
|
|
is_interrupted = is_interrupted_; |
|
|
|
} |
|
|
|
|
|
|
|
void CPUInterruptHandler::AwaitInterrupt() { |
|
|
|
|
|
|
|
@ -4,6 +4,7 @@ |
|
|
|
|
|
|
|
#pragma once |
|
|
|
|
|
|
|
#include <atomic> |
|
|
|
#include <memory> |
|
|
|
|
|
|
|
namespace Common { |
|
|
|
@ -32,8 +33,8 @@ public: |
|
|
|
void AwaitInterrupt(); |
|
|
|
|
|
|
|
private: |
|
|
|
bool is_interrupted{}; |
|
|
|
std::unique_ptr<Common::Event> interrupt_event; |
|
|
|
std::atomic_bool is_interrupted{false}; |
|
|
|
}; |
|
|
|
|
|
|
|
} // namespace Core |