summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-12-15 09:41:48 +0100
committerbunnei <bunneidev@gmail.com>2020-12-29 10:12:39 +0100
commitdfdac7d38af170683812f3b474ef9d686dfa9ef8 (patch)
treed72ff3fb593e6d42984b4d89863ae22cab3d77f5 /src/core/hle/kernel/kernel.h
parenthle: kernel: service_thread: Add thread name and take weak_ptr of ServerSession. (diff)
downloadyuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.tar
yuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.tar.gz
yuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.tar.bz2
yuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.tar.lz
yuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.tar.xz
yuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.tar.zst
yuzu-dfdac7d38af170683812f3b474ef9d686dfa9ef8.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/kernel.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 5846c3f39..e3169f5a7 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -42,6 +42,7 @@ class Process;
class ResourceLimit;
class KScheduler;
class SharedMemory;
+class ServiceThread;
class Synchronization;
class Thread;
class TimeManager;
@@ -227,6 +228,22 @@ public:
void ExitSVCProfile();
+ /**
+ * Creates an HLE service thread, which are used to execute service routines asynchronously.
+ * While these are allocated per ServerSession, these need to be owned and managed outside of
+ * ServerSession to avoid a circular dependency.
+ * @param name String name for the ServerSession creating this thread, used for debug purposes.
+ * @returns The a weak pointer newly created service thread.
+ */
+ std::weak_ptr<Kernel::ServiceThread> CreateServiceThread(const std::string& name);
+
+ /**
+ * Releases a HLE service thread, instructing KernelCore to free it. This should be called when
+ * the ServerSession associated with the thread is destroyed.
+ * @param service_thread Service thread to release.
+ */
+ void ReleaseServiceThread(std::weak_ptr<Kernel::ServiceThread> service_thread);
+
private:
friend class Object;
friend class Process;