Fixed wrong directory structure.

This commit is contained in:
Michael Müller
2022-06-30 12:13:19 +02:00
parent f9d28eb8e0
commit b255eb14fe
2 changed files with 29 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
TARGET = thread_test
SRC_CC = std_thread_test.cc
SRC_CC = thread_test.cc
LIBS += base libc stdcxx

View 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(); });
}