This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
hilbert-os/kernel/source/input.cpp

22 lines
571 B
C++

#include <hilbert/kernel/application.hpp>
#include <hilbert/kernel/input.hpp>
#include <hilbert/kernel/panic.hpp>
#include <hilbert/kernel/vfile.hpp>
namespace hilbert::kernel::input {
utility::queue<input_packet> *input_queue;
void init_input() {
input_queue = new utility::queue<input_packet>();
}
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);
}
}
}