android ndk x86 arm,How to use SIGRTMIN in x86 or armeabi-v7a abi in Android NDK?
問題
I am trying to use SIGRTMIN signal to create blocking signalhandler in Android NDK.
int startThread(){
pthread_t thread;
sigset_t set;
/* Block SIGRTMIN other threads created by main()
will inherit a copy of the signal mask. */
sigemptyset(&set);
int rc = sigaddset(&set, SIGRTMIN);
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "Return Code:%d",rc);
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "Error Code:%d",errno);
pthread_sigmask(SIG_BLOCK, &set, NULL);
pthread_create(&thread, NULL, &sig_thread, (void *) &set);
}
static void *sig_thread(void *arg)
{
sigset_t *set = arg;
int s, sig;
for (;;) {
s = sigwait(set, &sig);
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "Signal handling thread got signal %d\n", sig);
}
}
I am getting Return Code as -1 and Error code as 22 (EINVAL - Invalid Argument) while adding signal set sigaddset(&set, SIGRTMIN)
This is happening in x86 or armeabi-v7a abi. If i use x86_64 then it works.
is there any way to solve this problem or any alternative in x86/armeabi-v7a abi in Android?
來源:https://stackoverflow.com/questions/53481948/how-to-use-sigrtmin-in-x86-or-armeabi-v7a-abi-in-android-ndk
總結
以上是生活随笔為你收集整理的android ndk x86 arm,How to use SIGRTMIN in x86 or armeabi-v7a abi in Android NDK?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 魅族16Android版本,丝滑流畅?魅
- 下一篇: android的选项菜单,Android