From d42dfdf4b903763997d47b6e2214c2ce33b9bf8e Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 9 Jun 2021 21:59:17 +0800 Subject: import(life): Add operating system experiement. --- works/life/operating-system-experiment/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 works/life/operating-system-experiment/main.cpp (limited to 'works/life/operating-system-experiment/main.cpp') diff --git a/works/life/operating-system-experiment/main.cpp b/works/life/operating-system-experiment/main.cpp new file mode 100644 index 0000000..ada8c85 --- /dev/null +++ b/works/life/operating-system-experiment/main.cpp @@ -0,0 +1,16 @@ +#include "Thread.h" + +#include +#include + +int main() { + cru::Thread thread1([](const std::string &s) { std::cout << s; }, + "Hello world! 1\n"); + thread1.Join(); + + cru::Thread thread2([](const std::string &s) { std::cout << s; }, + "Hello world! 2\n"); + thread2.Join(); + + return 0; +} -- cgit v1.2.3