diff options
| author | Po Lu | 2023-06-16 15:50:56 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-16 15:50:56 +0800 |
| commit | 9ee639db23a8b86f5451c55eb43e424b3fc996dc (patch) | |
| tree | 6aed3d4194b3de704ff169ff3a1466c3c3b94869 /src | |
| parent | 377a3ebbb55a9b944551394e00d24c445e3ff4a1 (diff) | |
| download | emacs-9ee639db23a8b86f5451c55eb43e424b3fc996dc.tar.gz emacs-9ee639db23a8b86f5451c55eb43e424b3fc996dc.zip | |
Fix quitting after changes to signal delivery
* src/android.c (android_write_event, JNICALL)
(android_run_in_emacs_thread): Don't rely on raise to call
deliver_process_signal.
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/android.c b/src/android.c index 873d821361c..ccc2da95f03 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -698,7 +698,7 @@ android_write_event (union android_event *event) | |||
| 698 | IME. */ | 698 | IME. */ |
| 699 | case ANDROID_KEY_PRESS: | 699 | case ANDROID_KEY_PRESS: |
| 700 | case ANDROID_WINDOW_ACTION: | 700 | case ANDROID_WINDOW_ACTION: |
| 701 | raise (SIGIO); | 701 | kill (getpid (), SIGIO); |
| 702 | break; | 702 | break; |
| 703 | 703 | ||
| 704 | default: | 704 | default: |
| @@ -2580,10 +2580,13 @@ NATIVE_NAME (quit) (JNIEnv *env, jobject object) | |||
| 2580 | { | 2580 | { |
| 2581 | JNI_STACK_ALIGNMENT_PROLOGUE; | 2581 | JNI_STACK_ALIGNMENT_PROLOGUE; |
| 2582 | 2582 | ||
| 2583 | __android_log_print (ANDROID_LOG_VERBOSE, __func__, | ||
| 2584 | "Sending SIGIO and setting Vquit_flag"); | ||
| 2585 | |||
| 2583 | /* Raise sigio to interrupt anything that could be reading | 2586 | /* Raise sigio to interrupt anything that could be reading |
| 2584 | input. */ | 2587 | input. */ |
| 2585 | Vquit_flag = Qt; | 2588 | Vquit_flag = Qt; |
| 2586 | raise (SIGIO); | 2589 | kill (getpid (), SIGIO); |
| 2587 | } | 2590 | } |
| 2588 | 2591 | ||
| 2589 | JNIEXPORT jlong JNICALL | 2592 | JNIEXPORT jlong JNICALL |
| @@ -3122,8 +3125,8 @@ NATIVE_NAME (setupSystemThread) (void) | |||
| 3122 | used by the runtime. */ | 3125 | used by the runtime. */ |
| 3123 | 3126 | ||
| 3124 | sigfillset (&sigset); | 3127 | sigfillset (&sigset); |
| 3125 | sigaddset (&sigset, SIGSEGV); | 3128 | sigdelset (&sigset, SIGSEGV); |
| 3126 | sigaddset (&sigset, SIGBUS); | 3129 | sigdelset (&sigset, SIGBUS); |
| 3127 | 3130 | ||
| 3128 | if (pthread_sigmask (SIG_BLOCK, &sigset, NULL)) | 3131 | if (pthread_sigmask (SIG_BLOCK, &sigset, NULL)) |
| 3129 | __android_log_print (ANDROID_LOG_WARN, __func__, | 3132 | __android_log_print (ANDROID_LOG_WARN, __func__, |
| @@ -7327,7 +7330,7 @@ android_run_in_emacs_thread (void (*proc) (void *), void *closure) | |||
| 7327 | continue processing queries as soon as possible. */ | 7330 | continue processing queries as soon as possible. */ |
| 7328 | 7331 | ||
| 7329 | if (__atomic_load_n (&android_urgent_query, __ATOMIC_ACQUIRE)) | 7332 | if (__atomic_load_n (&android_urgent_query, __ATOMIC_ACQUIRE)) |
| 7330 | raise (SIGIO); | 7333 | kill (getpid (), SIGIO); |
| 7331 | 7334 | ||
| 7332 | again: | 7335 | again: |
| 7333 | rc = sem_timedwait (&android_query_sem, &timeout); | 7336 | rc = sem_timedwait (&android_query_sem, &timeout); |
| @@ -7354,7 +7357,7 @@ android_run_in_emacs_thread (void (*proc) (void *), void *closure) | |||
| 7354 | Normally, the main thread waits for the keyboard loop to be | 7357 | Normally, the main thread waits for the keyboard loop to be |
| 7355 | entered before responding, in order to avoid responding with | 7358 | entered before responding, in order to avoid responding with |
| 7356 | inaccurate results taken during command executioon. */ | 7359 | inaccurate results taken during command executioon. */ |
| 7357 | raise (SIGIO); | 7360 | kill (getpid (), SIGIO); |
| 7358 | 7361 | ||
| 7359 | /* Wait for the query to complete. `android_urgent_query' is | 7362 | /* Wait for the query to complete. `android_urgent_query' is |
| 7360 | only cleared by either `android_select' or | 7363 | only cleared by either `android_select' or |