summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/acc/async_context.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-09-29 05:42:50 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-10-02 05:38:59 +0200
commitfadcee14f8fca1b76b4ea48b1cfd136ccae8d182 (patch)
treea5787938bc73ff1b0b539e0945d3544d06a7d6d2 /src/core/hle/service/acc/async_context.cpp
parentMerge pull request #7102 from Morph1984/remove-boxcat (diff)
downloadyuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.tar
yuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.tar.gz
yuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.tar.bz2
yuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.tar.lz
yuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.tar.xz
yuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.tar.zst
yuzu-fadcee14f8fca1b76b4ea48b1cfd136ccae8d182.zip
Diffstat (limited to 'src/core/hle/service/acc/async_context.cpp')
-rw-r--r--src/core/hle/service/acc/async_context.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/hle/service/acc/async_context.cpp b/src/core/hle/service/acc/async_context.cpp
index 459323132..a49dfdec7 100644
--- a/src/core/hle/service/acc/async_context.cpp
+++ b/src/core/hle/service/acc/async_context.cpp
@@ -4,15 +4,12 @@
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/k_event.h"
#include "core/hle/service/acc/async_context.h"
namespace Service::Account {
IAsyncContext::IAsyncContext(Core::System& system_)
- : ServiceFramework{system_, "IAsyncContext"}, compeletion_event{system_.Kernel()} {
-
- Kernel::KAutoObject::Create(std::addressof(compeletion_event));
- compeletion_event.Initialize("IAsyncContext:CompletionEvent");
-
+ : ServiceFramework{system_, "IAsyncContext"}, service_context{system_, "IAsyncContext"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &IAsyncContext::GetSystemEvent, "GetSystemEvent"},
@@ -23,6 +20,12 @@ IAsyncContext::IAsyncContext(Core::System& system_)
// clang-format on
RegisterHandlers(functions);
+
+ completion_event = service_context.CreateEvent("IAsyncContext:CompletionEvent");
+}
+
+IAsyncContext::~IAsyncContext() {
+ service_context.CloseEvent(completion_event);
}
void IAsyncContext::GetSystemEvent(Kernel::HLERequestContext& ctx) {
@@ -30,7 +33,7 @@ void IAsyncContext::GetSystemEvent(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(compeletion_event.GetReadableEvent());
+ rb.PushCopyObjects(completion_event->GetReadableEvent());
}
void IAsyncContext::Cancel(Kernel::HLERequestContext& ctx) {
@@ -62,7 +65,7 @@ void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) {
void IAsyncContext::MarkComplete() {
is_complete.store(true);
- compeletion_event.GetWritableEvent().Signal();
+ completion_event->GetWritableEvent().Signal();
}
} // namespace Service::Account