aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/acc/async_context.h
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-09-12 12:03:10 -0400
committerGitHub <noreply@github.com>2021-09-12 12:03:10 -0400
commit4ab549e62a14de8c0ced8291ec46f659f0897c0e (patch)
tree2194407c4074dba61af2d288a1098103a13bb5a0 /src/core/hle/service/acc/async_context.h
parentf0f416e85cd23c97c51f33413b4f8eed57622502 (diff)
parent543081e4a198386a7208d0fe63411c149c4e36f5 (diff)
Merge pull request #6975 from ogniK5377/acc-async-ctx
account: EnsureTokenIdCacheAsync
Diffstat (limited to 'src/core/hle/service/acc/async_context.h')
-rw-r--r--src/core/hle/service/acc/async_context.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/hle/service/acc/async_context.h b/src/core/hle/service/acc/async_context.h
new file mode 100644
index 000000000..c694b4946
--- /dev/null
+++ b/src/core/hle/service/acc/async_context.h
@@ -0,0 +1,37 @@
+// Copyright 2021 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <atomic>
+#include "core/hle/kernel/k_event.h"
+#include "core/hle/service/service.h"
+
+namespace Core {
+class System;
+}
+
+namespace Service::Account {
+
+class IAsyncContext : public ServiceFramework<IAsyncContext> {
+public:
+ explicit IAsyncContext(Core::System& system_);
+
+ void GetSystemEvent(Kernel::HLERequestContext& ctx);
+ void Cancel(Kernel::HLERequestContext& ctx);
+ void HasDone(Kernel::HLERequestContext& ctx);
+ void GetResult(Kernel::HLERequestContext& ctx);
+
+protected:
+ virtual bool IsComplete() const = 0;
+ virtual void Cancel() = 0;
+ virtual ResultCode GetResult() const = 0;
+
+ void MarkComplete();
+
+ std::atomic<bool> is_complete{false};
+ Kernel::KEvent compeletion_event;
+};
+
+} // namespace Service::Account