summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-12-11 01:03:35 +0100
committerbunnei <bunneidev@gmail.com>2020-12-29 01:33:47 +0100
commit8bc3d66354972c8a288a56c9b75c9705597778f8 (patch)
tree24a1fb294cf8c9fbcd716f03ebd40b431676eeb6 /src/core/hle/kernel
parenthle: service: nvflinger: Refactor locking and interfaces. (diff)
downloadyuzu-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/hle/kernel')
-rw-r--r--src/core/hle/kernel/server_session.cpp2
-rw-r--r--src/core/hle/kernel/service_thread.cpp10
-rw-r--r--src/core/hle/kernel/service_thread.h2
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);