mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
Fixed wrong directory structure.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
TARGET = thread_test
|
||||
SRC_CC = std_thread_test.cc
|
||||
SRC_CC = thread_test.cc
|
||||
LIBS += base libc stdcxx
|
||||
28
repos/mml/src/app/thread_test/thread_test.cc
Normal file
28
repos/mml/src/app/thread_test/thread_test.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <base/component.h>
|
||||
#include <thread>
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
|
||||
namespace ThreadTest {
|
||||
struct Main;
|
||||
}
|
||||
|
||||
struct ThreadTest::Main
|
||||
{
|
||||
Genode::Env &_env;
|
||||
|
||||
void execute()
|
||||
{
|
||||
while(true) {
|
||||
std::cout << "Hello world" << std::endl;
|
||||
std::this_thread::sleep_for(std::chrone::seconds(1));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void Component::construct(Genode::Env &env)
|
||||
{
|
||||
static ThreadTest::Main main(env);
|
||||
std::thread([main]
|
||||
{ main->execute(); });
|
||||
}
|
||||
Reference in New Issue
Block a user