blob: 6118ea21fe71efcddc83330d7a360d780dc49338 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* -------------------------------------------
Copyright Mahrouss Logic
------------------------------------------- */
//
// Created by Amlal on 3/18/24
//
#ifndef __THREAD_API__
#define __THREAD_API__
#include <System.Core/Headers/Defines.hxx>
#define kThreadErrorExit -33
/// @brief Thread Information Block, which holds information about the running
/// thread.
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 TmCreateThread(const CharacterTypeUTF8* threadName, ThreadEntrypointKind threadStart);
/// @brief Dispoes the thread, and exits with code kThreadErrorExit
/// @param ref
/// @return
CA_EXTERN_C VoidType TmDisposeThread(ThreadRef ref);
#endif // __THREAD_API__
|