diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-10 06:27:05 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-12-29 01:33:47 +0100 |
commit | 28281ae2500a4af9c36c26de5ba07b80d440b335 (patch) | |
tree | 8113b0af071dbe7004f5f072862d47f557a9eb27 /src/core/hle/kernel/server_session.cpp | |
parent | Merge pull request #5233 from german77/inverted (diff) | |
download | yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.tar yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.tar.gz yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.tar.bz2 yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.tar.lz yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.tar.xz yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.tar.zst yuzu-28281ae2500a4af9c36c26de5ba07b80d440b335.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index a35c8aa4b..079c3911a 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -32,12 +32,9 @@ ResultVal<std::shared_ptr<ServerSession>> ServerSession::Create(KernelCore& kern std::string name) { std::shared_ptr<ServerSession> session{std::make_shared<ServerSession>(kernel)}; - session->request_event = - Core::Timing::CreateEvent(name, [session](std::uintptr_t, std::chrono::nanoseconds) { - session->CompleteSyncRequest(); - }); session->name = std::move(name); session->parent = std::move(parent); + session->service_thread = std::make_unique<ServiceThread>(kernel); return MakeResult(std::move(session)); } @@ -142,16 +139,12 @@ ResultCode ServerSession::QueueSyncRequest(std::shared_ptr<Thread> thread, std::make_shared<HLERequestContext>(kernel, memory, SharedFrom(this), std::move(thread)); context->PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf); - request_queue.Push(std::move(context)); + service_thread->QueueSyncRequest(*this, std::move(context)); return RESULT_SUCCESS; } -ResultCode ServerSession::CompleteSyncRequest() { - ASSERT(!request_queue.Empty()); - - auto& context = *request_queue.Front(); - +ResultCode ServerSession::CompleteSyncRequest(HLERequestContext& context) { ResultCode result = RESULT_SUCCESS; // If the session has been converted to a domain, handle the domain request if (IsDomain() && context.HasDomainMessageHeader()) { @@ -177,18 +170,13 @@ ResultCode ServerSession::CompleteSyncRequest() { } } - request_queue.Pop(); - return result; } ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread, Core::Memory::Memory& memory, Core::Timing::CoreTiming& core_timing) { - const ResultCode result = QueueSyncRequest(std::move(thread), memory); - const auto delay = std::chrono::nanoseconds{kernel.IsMulticore() ? 0 : 20000}; - core_timing.ScheduleEvent(delay, request_event, {}); - return result; + return QueueSyncRequest(std::move(thread), memory); } } // namespace Kernel |