diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-11 01:03:35 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-12-29 01:33:47 +0100 |
commit | 8bc3d66354972c8a288a56c9b75c9705597778f8 (patch) | |
tree | 24a1fb294cf8c9fbcd716f03ebd40b431676eeb6 /src/core | |
parent | hle: service: nvflinger: Refactor locking and interfaces. (diff) | |
download | yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.tar yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.tar.gz yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.tar.bz2 yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.tar.lz yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.tar.xz yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.tar.zst yuzu-8bc3d66354972c8a288a56c9b75c9705597778f8.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/service_thread.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/kernel/service_thread.h | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 079c3911a..ed42452ff 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -34,7 +34,7 @@ ResultVal<std::shared_ptr<ServerSession>> ServerSession::Create(KernelCore& kern session->name = std::move(name); session->parent = std::move(parent); - session->service_thread = std::make_unique<ServiceThread>(kernel); + session->service_thread = std::make_unique<ServiceThread>(kernel, 1); return MakeResult(std::move(session)); } diff --git a/src/core/hle/kernel/service_thread.cpp b/src/core/hle/kernel/service_thread.cpp index 59a6045df..4ceb7e56a 100644 --- a/src/core/hle/kernel/service_thread.cpp +++ b/src/core/hle/kernel/service_thread.cpp @@ -22,7 +22,7 @@ namespace Kernel { class ServiceThread::Impl final { public: - explicit Impl(KernelCore& kernel); + explicit Impl(KernelCore& kernel, std::size_t num_threads); ~Impl(); void QueueSyncRequest(ServerSession& session, std::shared_ptr<HLERequestContext>&& context); @@ -35,9 +35,8 @@ private: bool stop{}; }; -ServiceThread::Impl::Impl(KernelCore& kernel) { - constexpr std::size_t SizeOfPool{1}; - for (std::size_t i = 0; i < SizeOfPool; ++i) +ServiceThread::Impl::Impl(KernelCore& kernel, std::size_t num_threads) { + for (std::size_t i = 0; i < num_threads; ++i) threads.emplace_back([&] { // Wait for first request before trying to acquire a render context { @@ -88,7 +87,8 @@ ServiceThread::Impl::~Impl() { } } -ServiceThread::ServiceThread(KernelCore& kernel) : impl{std::make_unique<Impl>(kernel)} {} +ServiceThread::ServiceThread(KernelCore& kernel, std::size_t num_threads) + : impl{std::make_unique<Impl>(kernel, num_threads)} {} ServiceThread::~ServiceThread() = default; diff --git a/src/core/hle/kernel/service_thread.h b/src/core/hle/kernel/service_thread.h index d252490bb..91ad7ae85 100644 --- a/src/core/hle/kernel/service_thread.h +++ b/src/core/hle/kernel/service_thread.h @@ -14,7 +14,7 @@ class ServerSession; class ServiceThread final { public: - explicit ServiceThread(KernelCore& kernel); + explicit ServiceThread(KernelCore& kernel, std::size_t num_threads); ~ServiceThread(); void QueueSyncRequest(ServerSession& session, std::shared_ptr<HLERequestContext>&& context); |