diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-16 17:02:05 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-16 17:02:05 +0100 |
| commit | 90dad97fc07f049383903a166631e2c257f9b8c1 (patch) | |
| tree | 096cd247ecfda9e46598215a4f32aecedeedda90 /lib/libc/thread | |
| parent | 0e832a9329cc4d4647e1ce529846073f21e66991 (diff) | |
Add support for TLS in the libc
Diffstat (limited to 'lib/libc/thread')
| -rw-r--r-- | lib/libc/thread/thrd_current.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/thread/thrd_current.c b/lib/libc/thread/thrd_current.c index 69a99723..b588cc27 100644 --- a/lib/libc/thread/thrd_current.c +++ b/lib/libc/thread/thrd_current.c @@ -1,8 +1,9 @@ -#include <__thread.h> // for __thread_self -#include <threads.h> // for thrd_current, thrd_t +#include <__thread.h> +#include <threads.h> + +thread_local struct __thread_self __thread_self; thrd_t thrd_current(void) { - static struct __thread_self self = { 0 }; - return &self; + return &__thread_self; } |
