diff options
Diffstat (limited to 'kernel/source/input.cpp')
-rw-r--r-- | kernel/source/input.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/kernel/source/input.cpp b/kernel/source/input.cpp index 921ae7b..4f12e6e 100644 --- a/kernel/source/input.cpp +++ b/kernel/source/input.cpp @@ -6,17 +6,16 @@ namespace hilbert::kernel::input { utility::queue<input_packet> *input_queue; + utility::queue<application::thread *> *waiting_for_input; - void init_input() { - input_queue = new utility::queue<input_packet>(); + void notify_waiting() { + if (waiting_for_input->count > 0) + application::paused_threads->insert(waiting_for_input->take()); } - void got_input() { - if (application::threads_waiting_for_input->count > 0) { - auto *t = application::threads_waiting_for_input->take(); - t->state = application::thread_state::paused; - application::paused_threads->insert(t); - } + void init_input() { + input_queue = new utility::queue<input_packet>(); + waiting_for_input = new utility::queue<application::thread *>(); } } |