diff options
author | crupest <crupest@outlook.com> | 2021-06-09 21:59:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-09 21:59:17 +0800 |
commit | d42dfdf4b903763997d47b6e2214c2ce33b9bf8e (patch) | |
tree | 80d3266887b59ac8b7518c8ea3567b8ee05b26cf /works/life/operating-system-experiment/main.cpp | |
parent | 33ece81cf15b3cb8d4a005194acc67c3a3e5ad35 (diff) | |
download | crupest-d42dfdf4b903763997d47b6e2214c2ce33b9bf8e.tar.gz crupest-d42dfdf4b903763997d47b6e2214c2ce33b9bf8e.tar.bz2 crupest-d42dfdf4b903763997d47b6e2214c2ce33b9bf8e.zip |
import(life): Add operating system experiement.
Diffstat (limited to 'works/life/operating-system-experiment/main.cpp')
-rw-r--r-- | works/life/operating-system-experiment/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 <iostream>
+#include <string>
+
+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;
+}
|