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

21 lines
584 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;
utility::queue<application::thread *> *waiting_for_input;
void notify_waiting() {
if (waiting_for_input->count > 0)
application::paused_threads->insert(waiting_for_input->take());
}
void init_input() {
input_queue = new utility::queue<input_packet>();
waiting_for_input = new utility::queue<application::thread *>();
}
}