From a342bcc9b130e9bd78720e09e04c92dcac8840d0 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 27 Nov 2018 09:18:29 -0500 Subject: kernel/event: Reference ReadableEvent from WritableEvent --- src/core/hle/service/nifm/nifm.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/core/hle/service/nifm') diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 80a66bce3..60479bb45 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -58,10 +58,10 @@ public: RegisterHandlers(functions); auto& kernel = Core::System::GetInstance().Kernel(); - event1 = Kernel::WritableEvent::CreateRegisteredEventPair( - kernel, Kernel::ResetType::OneShot, "IRequest:Event1"); - event2 = Kernel::WritableEvent::CreateRegisteredEventPair( - kernel, Kernel::ResetType::OneShot, "IRequest:Event2"); + event1 = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::OneShot, + "IRequest:Event1"); + event2 = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::OneShot, + "IRequest:Event2"); } private: @@ -92,11 +92,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 2}; rb.Push(RESULT_SUCCESS); - - const auto& event1{Core::System::GetInstance().Kernel().FindNamedEvent("IRequest:Event1")}; - const auto& event2{Core::System::GetInstance().Kernel().FindNamedEvent("IRequest:Event2")}; - - rb.PushCopyObjects(event1->second, event2->second); + rb.PushCopyObjects(event1.readable, event2.readable); } void Cancel(Kernel::HLERequestContext& ctx) { @@ -113,7 +109,7 @@ private: rb.Push(RESULT_SUCCESS); } - Kernel::SharedPtr event1, event2; + Kernel::EventPair event1, event2; }; class INetworkProfile final : public ServiceFramework { -- cgit v1.2.3