summaryrefslogtreecommitdiff
path: root/src/systhread.c
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2017-07-01 12:58:49 +0100
committerAlan Third <alan@idiocy.org>2017-07-01 12:58:49 +0100
commit0ad5fd4b6cac1824e50e5e8c1a43878825e7d3de (patch)
tree0a8247163987e1c146583554fdbe508a435f6705 /src/systhread.c
parentff6d090ff73af57d6d489bc221d8f9eb6c0da633 (diff)
downloademacs-0ad5fd4b6cac1824e50e5e8c1a43878825e7d3de.tar.gz
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.
Diffstat (limited to 'src/systhread.c')
-rw-r--r--src/systhread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/systhread.c b/src/systhread.c
index a84060c18f0..aee12a9b482 100644
--- a/src/systhread.c
+++ b/src/systhread.c
@@ -20,6 +20,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <setjmp.h>
#include "lisp.h"
+#ifdef HAVE_NS
+#include "nsterm.h"
+#endif
+
#ifndef THREADS_ENABLED
void
@@ -130,6 +134,13 @@ void
sys_cond_broadcast (sys_cond_t *cond)
{
pthread_cond_broadcast (cond);
+#ifdef HAVE_NS
+ /* Send an app defined event to break out of the NS run loop.
+ It seems that if ns_select is running the NS run loop, this
+ broadcast has no effect until the loop is done, breaking a couple
+ of tests in thread-tests.el. */
+ ns_run_loop_break ();
+#endif
}
void