diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-09-12 18:03:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-12 18:03:10 +0200 |
commit | 4ab549e62a14de8c0ced8291ec46f659f0897c0e (patch) | |
tree | 2194407c4074dba61af2d288a1098103a13bb5a0 /src/core/hle/service/acc/async_context.h | |
parent | Merge pull request #6974 from ogniK5377/fs-recursive-createdir (diff) | |
parent | Mark is_complete as atomic (diff) | |
download | yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.tar yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.tar.gz yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.tar.bz2 yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.tar.lz yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.tar.xz yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.tar.zst yuzu-4ab549e62a14de8c0ced8291ec46f659f0897c0e.zip |
Diffstat (limited to 'src/core/hle/service/acc/async_context.h')
-rw-r--r-- | src/core/hle/service/acc/async_context.h | 37 |
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 |