android - Why does creating a C++11 thread cause a Fatal Signal? -
i want create c++11 thread runs indefinitely, after jni call has been made. why generate fatal signal?
#include <thread> static void teste() { while(true) logi("in test"); } jniexport void java_blahblah(jnienv *javaenvironment, jobject self) { std::thread t(teste); //t.join(); //i don't want join here. } i don't need c++11 thread call jni or that.
according this answer, destructor of thread call std::terminate if thread still joinable @ time of destruction.
if not want join thread, can fix detaching thread instead.
std::thread t(teste).detach();
Comments
Post a Comment