From e23727978dbb07d68f730ffa60b22d59d065850e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 22 Jul 2018 11:53:24 +0200 Subject: thread-join returns the result of finished thread * doc/lispref/threads.texi (Basic Thread Functions): * etc/NEWS: Document return value of `thread-join'. * src/thread.c (invoke_thread_function, Fmake_thread) (init_main_thread): Set result. (Fthread_join): Propagate signals, and return result. (Vmain_thread): New defvar. * src/thread.h (struct thread_state): Add `result' field. * test/src/thread-tests.el (threads-join): Test also return value. (threads-join-error): New test. (threads-mutex-signal): Check for propagation of `quit' signal. --- doc/lispref/threads.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/lispref/threads.texi') diff --git a/doc/lispref/threads.texi b/doc/lispref/threads.texi index 4cef9c9c6e8..58a3a918efd 100644 --- a/doc/lispref/threads.texi +++ b/doc/lispref/threads.texi @@ -75,8 +75,8 @@ thread, @code{nil} otherwise. @defun thread-join thread Block until @var{thread} exits, or until the current thread is -signaled. If @var{thread} has already exited, this returns -immediately. +signaled. It returns the result of the @var{thread} function. If +@var{thread} has already exited, this returns immediately. @end defun @defun thread-signal thread error-symbol data -- cgit v1.2.3