From b1a912a8a6ff472a49b2e0a09cfd433adfc2cb24 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 18 May 2024 21:53:38 -0400 Subject: reorganization, cross compiler --- kernel/source/input.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 kernel/source/input.cpp (limited to 'kernel/source/input.cpp') diff --git a/kernel/source/input.cpp b/kernel/source/input.cpp new file mode 100644 index 0000000..696cb13 --- /dev/null +++ b/kernel/source/input.cpp @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +namespace hilbert::kernel::input { + + utility::queue *key_queue; + + void init_input() { + key_queue = new utility::queue(); + } + + 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); + } + } + +} -- cgit v1.2.3