diff options
author | bunnei <bunneidev@gmail.com> | 2022-03-30 21:11:11 -0700 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-04-02 01:24:30 -0400 |
commit | 864523327f9526fa65c92d383ce8536392c0b888 (patch) | |
tree | 12cb4d4401135d7cb9a849f91f92c428cbba91e1 /src/core/hle/kernel/kernel.h | |
parent | 550844e5e8e52edfb88bffefc4663d64b9b49b88 (diff) |
hle: kernel: Create a default thread for services that do not need their own host thread.
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r-- | src/core/hle/kernel/kernel.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 4c68e96dfc..24e26fa44a 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -271,9 +271,11 @@ 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. + * Creates a host thread to execute HLE service requests, 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. In general, most + * services can just use the default service thread, and not need their own host service thread. + * See GetDefaultServiceThread. * @param name String name for the ServerSession creating this thread, used for debug * purposes. * @returns The a weak pointer newly created service thread. @@ -281,6 +283,14 @@ public: std::weak_ptr<Kernel::ServiceThread> CreateServiceThread(const std::string& name); /** + * Gets the default host service thread, which executes HLE service requests. Unless service + * requests need to block on the host, the default service thread should be used in favor of + * creating a new service thread. + * @returns The a weak pointer for the default service thread. + */ + std::weak_ptr<Kernel::ServiceThread> GetDefaultServiceThread() const; + + /** * 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. |