1

add lock to keyboard demo

This commit is contained in:
2022-07-19 00:01:24 +02:00
parent 3d76162d8a
commit e9b24d06be
2 changed files with 8 additions and 0 deletions

View File

@ -16,10 +16,17 @@ void KeyboardDemo::run() {
kout << "Keyboard Demo: " << endl;
kout.lock();
kout.clear();
kout << "Info: Die Keyboard Demo sperrt den Output Stream:\n"
<< " Wenn die Preemption Demo laeuft wird diese also erst\n"
<< " fortfahren wenn die Keyboard Demo wieder beendet ist." << endl;
while (true) {
kout << listener.waitForKeyEvent();
kout.flush();
}
kout.unlock();
scheduler.exit();
}

View File

@ -31,6 +31,7 @@ public:
~KeyboardDemo() override {
log << INFO << "Uninitialized KeyboardDemo" << endl;
kevman.unsubscribe(this->listener);
kout.unlock();
}
void run() override;