LibC/Kernel: Add support for detached pthreads

This commit is contained in:
2026-05-17 00:40:56 +03:00
parent ff75c15ba3
commit 9c79971bdc
5 changed files with 50 additions and 17 deletions

View File

@@ -214,6 +214,7 @@ namespace Kernel
BAN::ErrorOr<long> sys_pthread_join(pthread_t thread, void** value);
BAN::ErrorOr<long> sys_pthread_self();
BAN::ErrorOr<long> sys_pthread_kill(pthread_t thread, int signal);
BAN::ErrorOr<long> sys_pthread_detach(pthread_t thread);
BAN::ErrorOr<long> sys_clock_gettime(clockid_t, timespec*);

View File

@@ -117,6 +117,9 @@ namespace Kernel
const Process& process() const;
bool has_process() const { return m_process; }
void detach() { m_is_detached = true; }
bool is_detached() const { return m_is_detached; }
bool is_userspace() const { return m_is_userspace; }
uint64_t cpu_time_ns() const;
@@ -176,6 +179,7 @@ namespace Kernel
State m_state { State::NotStarted };
Process* m_process { nullptr };
bool m_is_userspace { false };
BAN::Atomic<bool> m_is_detached { false };
bool m_delete_process { false };
vaddr_t m_fsbase { 0 };