LibC: Cleanup pthread code and add some pthread_attr functions

errno, pthread cleanup and pthread id are now stored in uthread. This
allows using these without TLS
This commit is contained in:
2025-05-31 23:34:26 +03:00
parent 423386a052
commit c957f1ddca
17 changed files with 368 additions and 146 deletions

View File

@@ -1,12 +1,9 @@
#include <errno.h>
#include <pthread.h>
#if __disable_thread_local_storage
static int s_errno = 0;
#else
static thread_local int s_errno = 0;
#endif
extern uthread* _get_uthread();
int* __errno_location()
{
return &s_errno;
return &_get_uthread()->errno_;
}