1
std:thread
을 jni
에서 android
으로 간단하게 만들려고합니다. 하지만 내 응용 프로그램이 충돌하고 다음 오류가 발생합니다.std :: thread가 android JNI에서 SIGABRT를 발생시킵니다.
A/libc: Fatal signal 6 (SIGABRT) at 0x00005606 (code=-6), thread 22059
JNI 소스 :
void threadRun(){
sleep(5);
}
JNIEXPORT void JNICALL Java_com_helloworld_JNIWrapper_init
(JNIEnv *env, jobject obj)
{
thread th(threadRun);
th.join(); //or th.detach() doesn't work either
}
Application.mk :
APP_STL := gnustl_static
APP_CPPFLAGS += -std=c++11
내가 메인 UI 스레드에서의 활동에서 init
방법을했다. 배경 스레드에서 그것은 작동하지 않았다.