Fix unchecked runtime shutdown (#4575)
This commit is contained in:
committed by
Stanislav Erokhin
parent
b6497d07cf
commit
783517dbe8
@@ -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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user