From 5ab8bb9c497f673a81da693e9aacc78210718000 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 26 Mar 2024 20:00:41 +0100 Subject: Kernel: Implement more API calls. Signed-off-by: Amlal El Mahrouss --- Public/Developer/System.Core/Headers/Thread.hxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Public/Developer/System.Core/Headers/Thread.hxx') diff --git a/Public/Developer/System.Core/Headers/Thread.hxx b/Public/Developer/System.Core/Headers/Thread.hxx index df803860..a441041d 100644 --- a/Public/Developer/System.Core/Headers/Thread.hxx +++ b/Public/Developer/System.Core/Headers/Thread.hxx @@ -13,6 +13,8 @@ #include +#define kThreadErrorExit -33 + /// @brief Thread Information Block, which holds information about the running /// thread. typedef QWordType ThreadRef; @@ -20,4 +22,17 @@ typedef QWordType ThreadRef; /// @brief Main application thread. CA_EXTERN_C ThreadRef kMainThread; +typedef VoidType(*ThreadEntrypointKind)(VoidType); + +/// @brief Creates a new thread, and runs the code. +/// @param threadName the thread's name. +/// @param threadStart where to start. +/// @return +CA_EXTERN_C ThreadRef CreateThread(const CharacterTypeUTF8* threadName, ThreadEntrypointKind threadStart); + +/// @brief Dispoes the thread, and exits with code kThreadErrorExit +/// @param ref +/// @return +CA_EXTERN_C VoidType DisposeThread(ThreadRef ref); + #endif // __THREAD_API__ -- cgit v1.2.3