summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/bcat
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-01-31 10:38:57 +0100
committerbunnei <bunneidev@gmail.com>2021-02-05 23:03:32 +0100
commitff3c7c068b926399513bf7328c22e224ab0b53d6 (patch)
treec2a5d9f80ecf551659daa410cc384b1792eff31d /src/core/hle/service/bcat
parenthle: kernel: Implement KEvent. (diff)
downloadyuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.gz
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.bz2
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.lz
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.xz
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.tar.zst
yuzu-ff3c7c068b926399513bf7328c22e224ab0b53d6.zip
Diffstat (limited to 'src/core/hle/service/bcat')
-rw-r--r--src/core/hle/service/bcat/backend/backend.cpp14
-rw-r--r--src/core/hle/service/bcat/backend/backend.h8
2 files changed, 13 insertions, 9 deletions
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp
index 3b853e9e4..92d25dbe4 100644
--- a/src/core/hle/service/bcat/backend/backend.cpp
+++ b/src/core/hle/service/bcat/backend/backend.cpp
@@ -5,6 +5,9 @@
#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"
#include "core/hle/service/bcat/backend/backend.h"
@@ -12,12 +15,13 @@ namespace Service::BCAT {
ProgressServiceBackend::ProgressServiceBackend(Kernel::KernelCore& kernel,
std::string_view event_name) {
- event = Kernel::KWritableEvent::CreateEventPair(
- kernel, std::string("ProgressServiceBackend:UpdateEvent:").append(event_name));
+ event = Kernel::KEvent::Create(kernel,
+ "ProgressServiceBackend:UpdateEvent:" + std::string(event_name));
+ event->Initialize();
}
std::shared_ptr<Kernel::KReadableEvent> ProgressServiceBackend::GetEvent() const {
- return event.readable;
+ return event->GetReadableEvent();
}
DeliveryCacheProgressImpl& ProgressServiceBackend::GetImpl() {
@@ -85,9 +89,9 @@ void ProgressServiceBackend::FinishDownload(ResultCode result) {
void ProgressServiceBackend::SignalUpdate() const {
if (need_hle_lock) {
std::lock_guard lock(HLE::g_hle_lock);
- event.writable->Signal();
+ event->GetWritableEvent()->Signal();
} else {
- event.writable->Signal();
+ event->GetWritableEvent()->Signal();
}
}
diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h
index b190943ac..db585b069 100644
--- a/src/core/hle/service/bcat/backend/backend.h
+++ b/src/core/hle/service/bcat/backend/backend.h
@@ -11,8 +11,6 @@
#include "common/common_types.h"
#include "core/file_sys/vfs_types.h"
-#include "core/hle/kernel/k_readable_event.h"
-#include "core/hle/kernel/k_writable_event.h"
#include "core/hle/result.h"
namespace Core {
@@ -21,7 +19,9 @@ class System;
namespace Kernel {
class KernelCore;
-}
+class KEvent;
+class KReadableEvent;
+} // namespace Kernel
namespace Service::BCAT {
@@ -104,7 +104,7 @@ private:
void SignalUpdate() const;
DeliveryCacheProgressImpl impl{};
- Kernel::EventPair event;
+ std::shared_ptr<Kernel::KEvent> event;
bool need_hle_lock = false;
};