From 0ad5fd4b6cac1824e50e5e8c1a43878825e7d3de Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sat, 1 Jul 2017 12:58:49 +0100 Subject: Fix threads on NS (bug#25265) src/nsterm.h (ns_select): Compiler doesn't like sigmask being const. (ns_run_loop_break) [HAVE_PTHREAD]: New function. src/nsterm.m (ns_select): Call thread_select from within ns_select. (ns_run_loop_break) [HAVE_PTHREAD]: New function. (ns_send_appdefined): Don't wait for main thread when sending app defined event. src/process.c (wait_reading_process_output): Call thread_select from within ns_select. src/systhread.c (sys_cond_broadcast) [HAVE_NS]: Break ns_select out of its event loop using ns_run_loop_break. --- src/process.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index 2a1c2eecde3..abd017bb907 100644 --- a/src/process.c +++ b/src/process.c @@ -5371,14 +5371,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, nfds = xg_select (max_desc + 1, &Available, (check_write ? &Writeok : 0), NULL, &timeout, NULL); +#elif defined HAVE_NS + /* And NS builds call thread_select in ns_select. */ + nfds = ns_select (max_desc + 1, + &Available, (check_write ? &Writeok : 0), + NULL, &timeout, NULL); #else /* !HAVE_GLIB */ - nfds = thread_select ( -# ifdef HAVE_NS - ns_select -# else - pselect -# endif - , max_desc + 1, + nfds = thread_select (pselect, max_desc + 1, &Available, (check_write ? &Writeok : 0), NULL, &timeout, NULL); -- cgit v1.2.1