diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-17 06:20:16 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-17 06:20:16 +0100 |
| commit | fc6606edf84e483b780f5c0b990d355aab4dae8a (patch) | |
| tree | 78264cd5e168bee24d011597145b4c1f063187b9 | |
| parent | 3f47c53398a2cd10fe1b205e1393c3ceab4c675c (diff) | |
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | src/libPThread/PThreadKit/Thread.h | 5 | ||||
| -rw-r--r-- | src/libSystem/SystemKit/Macros.h | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/libPThread/PThreadKit/Thread.h b/src/libPThread/PThreadKit/Thread.h index 85f7a320..5282a623 100644 --- a/src/libPThread/PThreadKit/Thread.h +++ b/src/libPThread/PThreadKit/Thread.h @@ -8,8 +8,9 @@ #include <libPOSIXWrapper/POSIXKit/unistd.h> -#define PTHREAD_UNSAFE /* hint */ -#define PTHREAD_SAFE /* hint */ +/// @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 PTHREAD_SAFE SInt32 pthread_create(_Output ThreadRef* thread, VoidPtr attr, VoidPtr (*start_routine)(VoidPtr), VoidPtr arg); PTHREAD_SAFE SInt32 pthread_join(ThreadRef thread, VoidPtr* retval); diff --git a/src/libSystem/SystemKit/Macros.h b/src/libSystem/SystemKit/Macros.h index 37150b01..14918c41 100644 --- a/src/libSystem/SystemKit/Macros.h +++ b/src/libSystem/SystemKit/Macros.h @@ -15,6 +15,9 @@ #define ATTRIBUTE(X) __attribute__((X)) +#define __THREAD_SAFE ATTRIBUTE(thread_safe) +#define __THREAD_UNSAFE + #define IMPORT_CXX extern "C++" #define IMPORT_C extern "C" |
