summaryrefslogtreecommitdiff
path: root/kernel/source/input.cpp
blob: 4f12e6ece45a03bb155f945f2954442aa17ff4b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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 *>();
  }

}