From 656d32c6ae392758cc9773f2b60b2354cf9571ed Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 28 Nov 2020 16:16:39 +0000 Subject: [PATCH] .autotest git-svn-id: svn://ultimatepp.org/upp/trunk@15536 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- .../ThreadExitAllocator.cpp | 19 +++++++++++++++++++ .../ThreadExitAllocator.upp | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 autotest/ThreadExitAllocator/ThreadExitAllocator.cpp create mode 100644 autotest/ThreadExitAllocator/ThreadExitAllocator.upp diff --git a/autotest/ThreadExitAllocator/ThreadExitAllocator.cpp b/autotest/ThreadExitAllocator/ThreadExitAllocator.cpp new file mode 100644 index 000000000..b6a58b9d8 --- /dev/null +++ b/autotest/ThreadExitAllocator/ThreadExitAllocator.cpp @@ -0,0 +1,19 @@ +#include + +using namespace Upp; + +struct Foo { + const char *text; + Foo(const char *text) : text(text) { LOG("Foo: " << text); } + ~Foo() { LOG("~Foo: " << text); } +}; + +CONSOLE_APP_MAIN +{ + Thread t; + t.Run([] { + thread_local Foo foo("local in Thread"); + LOG("In the thread"); + }); + t.Wait(); +} diff --git a/autotest/ThreadExitAllocator/ThreadExitAllocator.upp b/autotest/ThreadExitAllocator/ThreadExitAllocator.upp new file mode 100644 index 000000000..885e84d64 --- /dev/null +++ b/autotest/ThreadExitAllocator/ThreadExitAllocator.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + ThreadExitAllocator.cpp; + +mainconfig + "" = ""; +