From 90dad97fc07f049383903a166631e2c257f9b8c1 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 16 Dec 2025 17:02:05 +0100 Subject: Add support for TLS in the libc --- lib/libc/thread/thrd_current.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/libc/thread') 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 // for thrd_current, thrd_t +#include <__thread.h> +#include + +thread_local struct __thread_self __thread_self; thrd_t thrd_current(void) { - static struct __thread_self self = { 0 }; - return &self; + return &__thread_self; } -- cgit v1.2.3