[kernel] Use map for process handles
Replace linearly-indexed vector of handles with new kutil::map. Also provide thread::current() and process::current() accessors so that every syscall doesn't need to include the scheduler to deduce the current process.
This commit is contained in:
@@ -50,6 +50,9 @@ public:
|
||||
/// Destructor
|
||||
virtual ~thread();
|
||||
|
||||
/// Get the currently executing thread.
|
||||
static thread & current();
|
||||
|
||||
/// Get the `ready` state of the thread.
|
||||
/// \returns True if the thread is ready to execute.
|
||||
inline bool ready() const { return has_state(state::ready); }
|
||||
|
||||
Reference in New Issue
Block a user