From 543532313a1d9570d6a74a7846b4e776a2282964 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 30 Dec 2016 11:36:07 +0200 Subject: Attempt to fix crashes with threads in GTK builds * src/xgselect.c (xg_select): Call pselect via thread_select, not directly, to avoid running Lisp (via unblock_input) when more than one thread could be running. (Bug#25247) * src/process.c (wait_reading_process_output) [HAVE_GLIB]: Call xg_select directly instead of through thread_select. * src/xgselect.h (xg_select): Last 2 arguments are no longer 'const', for consistency with thread_select. --- src/xgselect.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/xgselect.c') diff --git a/src/xgselect.c b/src/xgselect.c index a9461a5df5a..c73ef7ce5f2 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -25,6 +25,7 @@ along with GNU Emacs. If not, see . */ #include #include +#include "lisp.h" #include "blockinput.h" #include "systime.h" @@ -41,11 +42,11 @@ along with GNU Emacs. If not, see . */ int xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, - struct timespec const *timeout, sigset_t const *sigmask) + struct timespec *timeout, sigset_t *sigmask) { fd_set all_rfds, all_wfds; struct timespec tmo; - struct timespec const *tmop = timeout; + struct timespec *tmop = timeout; GMainContext *context; bool have_wfds = wfds != NULL; @@ -113,9 +114,9 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, } fds_lim = max_fds + 1; - nfds = pselect (fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, - efds, tmop, sigmask); - + nfds = thread_select (pselect, fds_lim, + &all_rfds, have_wfds ? &all_wfds : NULL, efds, + tmop, sigmask); if (nfds < 0) retval = nfds; else if (nfds > 0) -- cgit v1.2.1