Kenrel: Separate pthread API from kernel API

It didn't really make sense for the syscalls to be named as the pthread
equivalents. Now the kernel just uses thread ids
This commit is contained in:
2026-07-02 19:11:49 +03:00
parent 5540bc4147
commit f449ca8161
10 changed files with 58 additions and 62 deletions

View File

@@ -223,7 +223,7 @@ constexpr uintptr_t SYM_NOT_FOUND = -1;
static void lock_global_lock()
{
const pthread_t tid = syscall(SYS_PTHREAD_SELF);
const pthread_t tid = syscall(SYS_THREAD_GETID);
pthread_t expected = 0;
while (!s_global_locker.compare_exchange(expected, tid))
@@ -1359,7 +1359,7 @@ static void initialize_tls(MasterTLS master_tls)
.master_tls_module_count = master_tls.module_count,
.dynamic_tls = s_dynamic_tls,
.cleanup_stack = nullptr,
.id = static_cast<pthread_t>(syscall(SYS_PTHREAD_SELF)),
.id = static_cast<pthread_t>(syscall(SYS_THREAD_GETID)),
.errno_ = 0,
.cancel_type = PTHREAD_CANCEL_DEFERRED,
.cancel_state = PTHREAD_CANCEL_ENABLE,