aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/android.c')
-rw-r--r--src/android.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/android.c b/src/android.c
index 92aab548180..681723124ee 100644
--- a/src/android.c
+++ b/src/android.c
@@ -3077,6 +3077,30 @@ NATIVE_NAME (answerQuerySpin) (JNIEnv *env, jobject object)
3077 android_answer_query_spin (); 3077 android_answer_query_spin ();
3078} 3078}
3079 3079
3080
3081
3082/* System thread setup. Android doesn't always block signals Emacs is
3083 interested in from being received by the UI or render threads,
3084 which can lead to problems when those signals then interrupt one of
3085 those threads. */
3086
3087JNIEXPORT void JNICALL
3088NATIVE_NAME (setupSystemThread) (void)
3089{
3090 sigset_t sigset;
3091
3092 /* Block everything except for SIGSEGV and SIGBUS; those two are
3093 used by the runtime. */
3094
3095 sigfillset (&sigset);
3096 sigaddset (&sigset, SIGSEGV);
3097 sigaddset (&sigset, SIGBUS);
3098
3099 if (pthread_sigmask (SIG_BLOCK, &sigset, NULL))
3100 __android_log_print (ANDROID_LOG_WARN, __func__,
3101 "pthread_sigmask: %s", strerror (errno));
3102}
3103
3080#ifdef __clang__ 3104#ifdef __clang__
3081#pragma clang diagnostic pop 3105#pragma clang diagnostic pop
3082#else 3106#else