aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2020-09-22 23:48:09 +0200
committerjohannst <johannes.stoelp@gmail.com>2020-09-22 23:48:09 +0200
commit33f286000db35fe50639c237caa736deea304585 (patch)
treeddb74ebd1f626b200cbb5050545ded484dde4787 /example
parent488d4c6237c3f713077fe93e2745ba5defde0aa5 (diff)
downloadmatcha-threads-33f286000db35fe50639c237caa736deea304585.tar.gz
matcha-threads-33f286000db35fe50639c237caa736deea304585.zip
split classes into separate files, add arch specific subdir
Diffstat (limited to 'example')
-rw-r--r--example/demo1.cc (renamed from example/test.cc)7
1 files changed, 4 insertions, 3 deletions
diff --git a/example/test.cc b/example/demo1.cc
index c9691f3..1c910cd 100644
--- a/example/test.cc
+++ b/example/demo1.cc
@@ -1,11 +1,12 @@
/* Copyright (c) 2020 Johannes Stoelp */
-#include "lib/matcha.h"
+#include "lib/executor.h"
+#include "lib/thread.h"
#include <cstdio>
#include <memory>
-struct TestThread : public Thread {
+struct TestThread : public nMatcha::Thread {
TestThread(const char* name) : Thread(), mName(name) {}
virtual void threadFn() override {
@@ -21,7 +22,7 @@ struct TestThread : public Thread {
int main() {
puts("[main] start main thread");
- Executor e;
+ nMatcha::Executor e;
e.spawn(std::make_unique<TestThread>("Thread1"));
e.spawn(std::make_unique<TestThread>("Thread2"));
e.spawn(std::make_unique<TestThread>("Thread3"));