diff options
| author | 2021-04-04 00:56:09 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:50 -0700 | |
| commit | addc0bf0379e075786048921bede6e089552a6db (patch) | |
| tree | 7fa8819b52db29e1b354410441dd8f2438e2ed4a /src/core/hle/service/nim | |
| parent | hle: kernel: Migrate KSharedMemory to KAutoObject. (diff) | |
| download | yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.gz yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.xz yuzu-addc0bf0379e075786048921bede6e089552a6db.zip | |
hle: kernel: Migrate KEvent to KAutoObject.
Diffstat (limited to 'src/core/hle/service/nim')
| -rw-r--r-- | src/core/hle/service/nim/nim.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index fee360ab9..6d66ad90b 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp | |||
| @@ -300,7 +300,8 @@ class IEnsureNetworkClockAvailabilityService final | |||
| 300 | : public ServiceFramework<IEnsureNetworkClockAvailabilityService> { | 300 | : public ServiceFramework<IEnsureNetworkClockAvailabilityService> { |
| 301 | public: | 301 | public: |
| 302 | explicit IEnsureNetworkClockAvailabilityService(Core::System& system_) | 302 | explicit IEnsureNetworkClockAvailabilityService(Core::System& system_) |
| 303 | : ServiceFramework{system_, "IEnsureNetworkClockAvailabilityService"} { | 303 | : ServiceFramework{system_, "IEnsureNetworkClockAvailabilityService"}, |
| 304 | finished_event{system.Kernel()} { | ||
| 304 | static const FunctionInfo functions[] = { | 305 | static const FunctionInfo functions[] = { |
| 305 | {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, | 306 | {0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"}, |
| 306 | {1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, | 307 | {1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, |
| @@ -312,19 +313,16 @@ public: | |||
| 312 | }; | 313 | }; |
| 313 | RegisterHandlers(functions); | 314 | RegisterHandlers(functions); |
| 314 | 315 | ||
| 315 | auto& kernel = system.Kernel(); | 316 | finished_event.Initialize("IEnsureNetworkClockAvailabilityService:FinishEvent"); |
| 316 | finished_event = | ||
| 317 | Kernel::KEvent::Create(kernel, "IEnsureNetworkClockAvailabilityService:FinishEvent"); | ||
| 318 | finished_event->Initialize(); | ||
| 319 | } | 317 | } |
| 320 | 318 | ||
| 321 | private: | 319 | private: |
| 322 | std::shared_ptr<Kernel::KEvent> finished_event; | 320 | Kernel::KEvent finished_event; |
| 323 | 321 | ||
| 324 | void StartTask(Kernel::HLERequestContext& ctx) { | 322 | void StartTask(Kernel::HLERequestContext& ctx) { |
| 325 | // No need to connect to the internet, just finish the task straight away. | 323 | // No need to connect to the internet, just finish the task straight away. |
| 326 | LOG_DEBUG(Service_NIM, "called"); | 324 | LOG_DEBUG(Service_NIM, "called"); |
| 327 | finished_event->GetWritableEvent()->Signal(); | 325 | finished_event.GetWritableEvent()->Signal(); |
| 328 | IPC::ResponseBuilder rb{ctx, 2}; | 326 | IPC::ResponseBuilder rb{ctx, 2}; |
| 329 | rb.Push(RESULT_SUCCESS); | 327 | rb.Push(RESULT_SUCCESS); |
| 330 | } | 328 | } |
| @@ -334,7 +332,7 @@ private: | |||
| 334 | 332 | ||
| 335 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 333 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 336 | rb.Push(RESULT_SUCCESS); | 334 | rb.Push(RESULT_SUCCESS); |
| 337 | rb.PushCopyObjects(finished_event->GetReadableEvent()); | 335 | rb.PushCopyObjects(finished_event.GetReadableEvent()); |
| 338 | } | 336 | } |
| 339 | 337 | ||
| 340 | void GetResult(Kernel::HLERequestContext& ctx) { | 338 | void GetResult(Kernel::HLERequestContext& ctx) { |
| @@ -346,7 +344,7 @@ private: | |||
| 346 | 344 | ||
| 347 | void Cancel(Kernel::HLERequestContext& ctx) { | 345 | void Cancel(Kernel::HLERequestContext& ctx) { |
| 348 | LOG_DEBUG(Service_NIM, "called"); | 346 | LOG_DEBUG(Service_NIM, "called"); |
| 349 | finished_event->GetWritableEvent()->Clear(); | 347 | finished_event.GetWritableEvent()->Clear(); |
| 350 | IPC::ResponseBuilder rb{ctx, 2}; | 348 | IPC::ResponseBuilder rb{ctx, 2}; |
| 351 | rb.Push(RESULT_SUCCESS); | 349 | rb.Push(RESULT_SUCCESS); |
| 352 | } | 350 | } |