enable helloworld thread demo
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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 ©); // Verhindere Kopieren
|
||||
HelloWorldThread(const HelloWorldThread& copy) = delete; // Verhindere Kopieren
|
||||
|
||||
public:
|
||||
HelloWorldThread () : Thread () { }
|
||||
HelloWorldThread() {}
|
||||
|
||||
// Thread-Startmethode
|
||||
void run ();
|
||||
|
||||
};
|
||||
void run() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user