mardi 28 avril 2015

Why does creating a C++11 thread cause a Fatal Signal?

I want to create a C++11 thread that runs indefinitely, after a JNI call has been made. Why does this generate a 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 to join it here.
}

I don't need the C++11 thread to call JNI or anything like that.

Aucun commentaire:

Enregistrer un commentaire