]> git.eshelyaron.com Git - emacs.git/commit
Fully support Lisp threads on Android
authorPo Lu <luangruo@yahoo.com>
Fri, 28 Feb 2025 11:49:34 +0000 (19:49 +0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Mar 2025 20:51:15 +0000 (21:51 +0100)
commit7b99faecec110a92fa270c40b0b69247525d7ba9
treee076783b374845f932766d58c0e7ee0d904d353e
parent5c8a37e9b6174dd42baf8cca24d4fcff6d2da7d8
Fully support Lisp threads on Android

* src/android.c (struct android_thread_event_queue): New
structure.  Move global pselect arguments, mutexes, and
semaphores, and pipes here.
(struct android_event_queue) <select_mutex, select_thread>:
Remove to the above-named struct.
(android_init_thread_events, android_finalize_thread_events)
(android_get_poll_thread): New functions.
(android_run_select_thread): Accept a set of mutexes and
thread-local data as the first argument, and operate with them
rather than globals.
(android_handle_sigusr1): Rename to
`android_handle_poll_signal'.  Set thread-specific cancellation
indicator.
(android_init_events): Properly abort after a fatal condition.
Enable interruptible polling on Android 5.1 and later, not 4.2.
(android_select): Never check for queries here, but in
thread_select, if threads are enabled.  Adapt to per-thread
polling threads and only enable interruptible polling on Android
5.1 and later.
(android_before_select): New function.

* src/android.h (android_before_select): New declaration.

* src/thread.c (thread_select): Call `android_before_select'
before the global lock is released.

(cherry picked from commit 8df582a46836e312ef3bfc36c8038b5f4a2c0d9b)
src/android.c
src/android.h
src/thread.c