aboutsummaryrefslogtreecommitdiffstats
path: root/tests/threadtest.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-11-12 22:30:20 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-11-12 22:30:20 +0000
commite68759a4101567a27e306eae0a907baa759ae80c (patch)
treec90733351cb7a8a02f91725118593c1c4f19c563 /tests/threadtest.cpp
parent5fb7c972d44a3ce0a067101885d2e0c1966e7c89 (diff)
downloadYAGE-e68759a4101567a27e306eae0a907baa759ae80c.tar.gz
YAGE-e68759a4101567a27e306eae0a907baa759ae80c.zip
Designing simple preview game
Diffstat (limited to 'tests/threadtest.cpp')
-rw-r--r--tests/threadtest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/threadtest.cpp b/tests/threadtest.cpp
new file mode 100644
index 00000000..dd1877e5
--- /dev/null
+++ b/tests/threadtest.cpp
@@ -0,0 +1,23 @@
+#include <yage.h>
+
+#include <iostream>
+#include <thread>
+
+int main()
+{
+ int n = 5;
+
+ std::cout << "n before: " << n << "\n";
+
+ auto f = [&] () {
+ n = 8;
+ };
+
+ std::thread t1(f);
+
+ std::cout << "n after: " << n << "\n";
+
+ t1.join();
+
+ std::cout << "n after thread: " << n << "\n";
+}