diff --git a/src/kernel/objects/process.cpp b/src/kernel/objects/process.cpp index 37012ab..2ccd2aa 100644 --- a/src/kernel/objects/process.cpp +++ b/src/kernel/objects/process.cpp @@ -93,7 +93,7 @@ process::update() thread * process::create_thread(uint8_t priority, bool user) { - if (priority == default_pri) + if (priority == default_priority) priority = scheduler::default_priority; thread *th = new thread(*this, priority); @@ -123,6 +123,8 @@ process::thread_exited(thread *th) remove_handle(th->self_handle()); delete th; + // TODO: delete the thread's stack VMA + if (m_threads.count() == 0) { exit(status); return true; diff --git a/src/kernel/objects/process.h b/src/kernel/objects/process.h index e20dc20..c9d9c00 100644 --- a/src/kernel/objects/process.h +++ b/src/kernel/objects/process.h @@ -19,7 +19,7 @@ public: constexpr static size_t stack_size = 0x4000; /// Value that represents default priority - constexpr static uint8_t default_pri = 0xff; + constexpr static uint8_t default_priority = 0xff; /// Constructor. process(); @@ -46,7 +46,7 @@ public: /// \args priority The new thread's scheduling priority /// \args user If true, create a userspace stack for this thread /// \returns The newly created thread object - thread * create_thread(uint8_t priorty = default_pri, bool user = true); + thread * create_thread(uint8_t priorty = default_priority, bool user = true); /// Start tracking an object with a handle. /// \args obj The object this handle refers to