1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

Kernel+LibPthread: pthread_create handles pthread_attr_t

Add an initial implementation of pthread attributes for:
  * detach state (joinable, detached)
  * schedule params (just priority)
  * guard page size (as skeleton) (requires kernel support maybe?)
  * stack size and user-provided stack location (4 or 8 MB only, must be aligned)

Add some tests too, to the thread test program.

Also, LibC: Move pthread declarations to sys/types.h, where they belong.
This commit is contained in:
Andrew Kaster 2019-11-17 20:08:10 -07:00 committed by Andreas Kling
parent aae26a3a1e
commit 618aebdd8a
9 changed files with 596 additions and 23 deletions

View file

@ -63,6 +63,9 @@ public:
void set_priority(ThreadPriority p) { m_priority = p; }
ThreadPriority priority() const { return m_priority; }
void set_joinable(bool j) { m_is_joinable = j; }
bool is_joinable() const { return m_is_joinable; }
Process& process() { return m_process; }
const Process& process() const { return m_process; }
@ -368,6 +371,7 @@ private:
SignalActionData m_signal_action_data[32];
Blocker* m_blocker { nullptr };
bool m_is_joinable { true };
Thread* m_joiner { nullptr };
Thread* m_joinee { nullptr };
void* m_exit_value { nullptr };