[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:
2020-09-13 15:54:47 -07:00
parent 245f260d67
commit 9dee5e4138
6 changed files with 43 additions and 43 deletions

View File

@@ -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); }