1

enable helloworld thread demo

This commit is contained in:
churl
2022-06-05 16:58:02 +02:00
parent 973c76f010
commit f7b6cb658d
3 changed files with 16 additions and 15 deletions

View File

@ -11,6 +11,7 @@
*****************************************************************************/
#include "kernel/Globals.h"
#include "user/HelloWorldThread.h"
int main() {
kout.clear();
@ -50,8 +51,14 @@ int main() {
// key_irq_demo();
// coroutineDemo.main();
// Threads anlegen
scheduler.ready(new HelloWorldThread());
// Scheduler starten (schedule() erzeugt den Idle-Thread)
scheduler.schedule();
// TODO: Use templates for queue so threads don't have to be casted down from chain
// TODO: Move scrollback control to thread
return 0;
}

View File

@ -8,20 +8,18 @@
* Autor: Michael Schoettner, HHU, 21.8.2016 *
*****************************************************************************/
#include "kernel/Globals.h"
#include "user/HelloWorldThread.h"
#include "kernel/Globals.h"
/*****************************************************************************
* Methode: HelloWorldThread::run *
*---------------------------------------------------------------------------*
* Beschreibung: Einstiegsfunktion in unseren Thread. *
*****************************************************************************/
void HelloWorldThread::run () {
void HelloWorldThread::run() {
kout << "Hallo Welt von einem Thread!" << endl;
// selbst terminieren
scheduler.exit ();
scheduler.exit();
}

View File

@ -10,21 +10,17 @@
#ifndef __hello_world_thread_include__
#define __hello_world_thread_include__
#include "kernel/threads/Thread.h"
class HelloWorldThread : public Thread {
private:
HelloWorldThread (const HelloWorldThread &copy); // Verhindere Kopieren
HelloWorldThread(const HelloWorldThread& copy) = delete; // Verhindere Kopieren
public:
HelloWorldThread () : Thread () { }
HelloWorldThread() {}
// Thread-Startmethode
void run ();
};
void run() override;
};
#endif