mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Get rid of obsolete thread loading state
The thread::state::loading flag was left over from a time when the kernel did elf loading for all processes.
This commit is contained in:
@@ -20,7 +20,7 @@ static constexpr j6_signal_t thread_default_signals = 0;
|
|||||||
thread::thread(process &parent, uint8_t pri, uintptr_t rsp0) :
|
thread::thread(process &parent, uint8_t pri, uintptr_t rsp0) :
|
||||||
kobject(kobject::type::thread, thread_default_signals),
|
kobject(kobject::type::thread, thread_default_signals),
|
||||||
m_parent(parent),
|
m_parent(parent),
|
||||||
m_state(state::loading),
|
m_state(state::none),
|
||||||
m_wait_type(wait_type::none),
|
m_wait_type(wait_type::none),
|
||||||
m_wait_data(0),
|
m_wait_data(0),
|
||||||
m_wait_obj(0)
|
m_wait_obj(0)
|
||||||
|
|||||||
@@ -67,11 +67,11 @@ public:
|
|||||||
constexpr static j6_cap_t parent_caps = j6_cap_thread_all;
|
constexpr static j6_cap_t parent_caps = j6_cap_thread_all;
|
||||||
|
|
||||||
enum class state : uint8_t {
|
enum class state : uint8_t {
|
||||||
|
none = 0x00,
|
||||||
ready = 0x01,
|
ready = 0x01,
|
||||||
loading = 0x02,
|
exited = 0x02,
|
||||||
exited = 0x04,
|
|
||||||
constant = 0x80,
|
constant = 0x80
|
||||||
none = 0x00
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
@@ -86,10 +86,6 @@ public:
|
|||||||
/// \returns True if the thread is ready to execute.
|
/// \returns True if the thread is ready to execute.
|
||||||
inline bool ready() const { return has_state(state::ready); }
|
inline bool ready() const { return has_state(state::ready); }
|
||||||
|
|
||||||
/// Get the `loading` state of the thread.
|
|
||||||
/// \returns True if the thread has not finished loading.
|
|
||||||
inline bool loading() const { return has_state(state::loading); }
|
|
||||||
|
|
||||||
/// Get the `constant` state of the thread.
|
/// Get the `constant` state of the thread.
|
||||||
/// \returns True if the thread has constant priority.
|
/// \returns True if the thread has constant priority.
|
||||||
inline bool constant() const { return has_state(state::constant); }
|
inline bool constant() const { return has_state(state::constant); }
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ thread_create(j6_handle_t *self, process *proc, uintptr_t stack_top, uintptr_t e
|
|||||||
thread *child = proc->create_thread(stack_top);
|
thread *child = proc->create_thread(stack_top);
|
||||||
child->add_thunk_user(entrypoint);
|
child->add_thunk_user(entrypoint);
|
||||||
*self = child->self_handle();
|
*self = child->self_handle();
|
||||||
child->clear_state(thread::state::loading);
|
|
||||||
child->set_state(thread::state::ready);
|
child->set_state(thread::state::ready);
|
||||||
|
|
||||||
log::debug(logs::task, "Thread %llx:%llx spawned new thread %llx:%llx",
|
log::debug(logs::task, "Thread %llx:%llx spawned new thread %llx:%llx",
|
||||||
|
|||||||
Reference in New Issue
Block a user