diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-20 10:21:56 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-20 10:21:56 +0100 |
| commit | eced0b64537b0f2da4fedeb597c8d194eb8acc76 (patch) | |
| tree | db9b1d1082d0d5e82f52c1b59a2ba960fb5991ed /src/libPThread/PThreadKit/Thread.h | |
| parent | 66617026146e24f7a38b0f1c952601f4442dceaa (diff) | |
[FEAT] PThread and POSIXKit separation.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/libPThread/PThreadKit/Thread.h')
| -rw-r--r-- | src/libPThread/PThreadKit/Thread.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libPThread/PThreadKit/Thread.h b/src/libPThread/PThreadKit/Thread.h index de8efe8a..02c1a574 100644 --- a/src/libPThread/PThreadKit/Thread.h +++ b/src/libPThread/PThreadKit/Thread.h @@ -8,16 +8,15 @@ #include <libPOSIXWrapper/POSIXKit/unistd.h> -/// @brief Please use these macros to specify whether your function is thread safe or not. -#define PTHREAD_UNSAFE __THREAD_UNSAFE -#define PTHREAD_SAFE __THREAD_SAFE +/// @internal Internal type, please do not rely on it for multi-platform builds. +typedef ThreadRef pthread_ref_t; -PTHREAD_SAFE SInt32 pthread_create(_Output ThreadRef* thread, VoidPtr attr, +PTHREAD_SAFE IMPORT_C SInt32 pthread_create(_Output pthread_ref_t* thread, VoidPtr attr, VoidPtr (*start_routine)(VoidPtr), VoidPtr arg); -PTHREAD_SAFE SInt32 pthread_join(ThreadRef thread, VoidPtr* retval); -PTHREAD_SAFE SInt32 pthread_exit(SInt32 retval); -PTHREAD_SAFE SInt32 pthread_detach(ThreadRef thread); -PTHREAD_SAFE ThreadRef pthread_self(Void); -PTHREAD_SAFE SInt32 pthread_yield(void); +PTHREAD_SAFE IMPORT_C SInt32 pthread_join(pthread_ref_t thread, VoidPtr* retval); +PTHREAD_SAFE IMPORT_C SInt32 pthread_exit(SInt32 retval); +PTHREAD_SAFE IMPORT_C SInt32 pthread_detach(pthread_ref_t thread); +PTHREAD_SAFE IMPORT_C pthread_ref_t pthread_self(Void); +PTHREAD_SAFE IMPORT_C SInt32 pthread_yield(void); #endif // LIBPOSIX_POSIXKIT_THREAD_H |
