diff options
Diffstat (limited to 'src/core/hle/service/bcat')
-rw-r--r-- | src/core/hle/service/bcat/backend/backend.cpp | 14 | ||||
-rw-r--r-- | src/core/hle/service/bcat/backend/backend.h | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp index 7f301fdeb..932e70bfd 100644 --- a/src/core/hle/service/bcat/backend/backend.cpp +++ b/src/core/hle/service/bcat/backend/backend.cpp @@ -5,7 +5,6 @@ #include "common/hex_util.h" #include "common/logging/log.h" #include "core/core.h" -#include "core/hle/kernel/k_event.h" #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_writable_event.h" #include "core/hle/lock.h" @@ -14,14 +13,13 @@ namespace Service::BCAT { ProgressServiceBackend::ProgressServiceBackend(Kernel::KernelCore& kernel, - std::string_view event_name) { - event = Kernel::KEvent::Create(kernel, - "ProgressServiceBackend:UpdateEvent:" + std::string(event_name)); - event->Initialize(); + std::string_view event_name) + : update_event{kernel} { + update_event.Initialize("ProgressServiceBackend:UpdateEvent:" + std::string(event_name)); } std::shared_ptr<Kernel::KReadableEvent> ProgressServiceBackend::GetEvent() const { - return SharedFrom(event->GetReadableEvent()); + return update_event.GetReadableEvent(); } DeliveryCacheProgressImpl& ProgressServiceBackend::GetImpl() { @@ -89,9 +87,9 @@ void ProgressServiceBackend::FinishDownload(ResultCode result) { void ProgressServiceBackend::SignalUpdate() const { if (need_hle_lock) { std::lock_guard lock(HLE::g_hle_lock); - event->GetWritableEvent()->Signal(); + update_event.GetWritableEvent()->Signal(); } else { - event->GetWritableEvent()->Signal(); + update_event.GetWritableEvent()->Signal(); } } diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h index db585b069..baa4d576a 100644 --- a/src/core/hle/service/bcat/backend/backend.h +++ b/src/core/hle/service/bcat/backend/backend.h @@ -11,6 +11,7 @@ #include "common/common_types.h" #include "core/file_sys/vfs_types.h" +#include "core/hle/kernel/k_event.h" #include "core/hle/result.h" namespace Core { @@ -104,7 +105,7 @@ private: void SignalUpdate() const; DeliveryCacheProgressImpl impl{}; - std::shared_ptr<Kernel::KEvent> event; + Kernel::KEvent update_event; bool need_hle_lock = false; }; |