mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 14:52:45 +01:00
cpu_interrupt_handler: Make is_interrupted an atomic
Fixes a race condition detected from tsan
This commit is contained in:
parent
4efaecf125
commit
ea7bda25ba
2 changed files with 3 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
CPUInterruptHandler::CPUInterruptHandler() : is_interrupted{} {
|
||||
CPUInterruptHandler::CPUInterruptHandler() {
|
||||
interrupt_event = std::make_unique<Common::Event>();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
namespace Common {
|
||||
|
@ -32,7 +33,7 @@ public:
|
|||
void AwaitInterrupt();
|
||||
|
||||
private:
|
||||
bool is_interrupted{};
|
||||
std::atomic_bool is_interrupted{false};
|
||||
std::unique_ptr<Common::Event> interrupt_event;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue