mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 21:06:58 -05:00
Mark is_complete as atomic
This commit is contained in:
parent
89958e27aa
commit
543081e4a1
2 changed files with 5 additions and 4 deletions
|
@ -46,11 +46,11 @@ void IAsyncContext::Cancel(Kernel::HLERequestContext& ctx) {
|
||||||
void IAsyncContext::HasDone(Kernel::HLERequestContext& ctx) {
|
void IAsyncContext::HasDone(Kernel::HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_ACC, "called");
|
LOG_DEBUG(Service_ACC, "called");
|
||||||
|
|
||||||
is_complete = IsComplete();
|
is_complete.store(IsComplete());
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
rb.Push(is_complete);
|
rb.Push(is_complete.load());
|
||||||
}
|
}
|
||||||
|
|
||||||
void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) {
|
void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) {
|
||||||
|
@ -61,7 +61,7 @@ void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void IAsyncContext::MarkComplete() {
|
void IAsyncContext::MarkComplete() {
|
||||||
is_complete = true;
|
is_complete.store(true);
|
||||||
compeletion_event.GetWritableEvent().Signal();
|
compeletion_event.GetWritableEvent().Signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ protected:
|
||||||
|
|
||||||
void MarkComplete();
|
void MarkComplete();
|
||||||
|
|
||||||
bool is_complete{false};
|
std::atomic<bool> is_complete{false};
|
||||||
Kernel::KEvent compeletion_event;
|
Kernel::KEvent compeletion_event;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue