/* Copyright (c) 2020 Johannes Stoelp */ #include "lib/matcha.h" #include #include struct TestThread : public Thread { TestThread(const char* name) : Thread(), mName(name) {} virtual void threadFn() override { printf("[%s] starting up TestThread -> yield()\n", mName); yield(); printf("[%s] yield() -> finishing TestThreads\n", mName); } private: const char* mName; }; int main() { puts("[main] start main thread"); Executor e; e.spawn(std::make_unique("Thread1")); e.spawn(std::make_unique("Thread2")); e.spawn(std::make_unique("Thread3")); e.run(); puts("[main] finish main thread"); return 0; }