Fix unchecked runtime shutdown (#4575)

This commit is contained in:
Alexander Shabalin
2020-12-08 10:17:52 +03:00
committed by Stanislav Erokhin
parent b6497d07cf
commit 783517dbe8
7 changed files with 106 additions and 4 deletions
@@ -0,0 +1,15 @@
#include "leakMemory.h"
#include <atomic>
#include <thread>
extern "C" void test_RunInNewThread(void (*f)()) {
std::atomic<bool> haveRun(false);
std::thread t([f, &haveRun]() {
f();
haveRun = true;
while (true) {}
});
t.detach();
while (!haveRun) {}
}