cannot thread-join the current thread
This commit is contained in:
parent
599d4a9940
commit
587dd92ea0
2 changed files with 7 additions and 0 deletions
|
@ -852,6 +852,9 @@ It is an error for a thread to try to join itself. */)
|
|||
CHECK_THREAD (thread);
|
||||
tstate = XTHREAD (thread);
|
||||
|
||||
if (tstate == current_thread)
|
||||
error ("cannot join current thread");
|
||||
|
||||
if (tstate->m_specpdl != NULL)
|
||||
flush_stack_call_func (thread_join_callback, tstate);
|
||||
|
||||
|
|
|
@ -70,6 +70,10 @@
|
|||
(and threads-test-global
|
||||
(not (thread-alive-p thread)))))))
|
||||
|
||||
(ert-deftest threads-join-self ()
|
||||
"cannot thread-join the current thread"
|
||||
(should-error (thread-join (current-thread))))
|
||||
|
||||
(defvar threads-test-binding nil)
|
||||
|
||||
(defun threads-test-thread2 ()
|
||||
|
|
Loading…
Add table
Reference in a new issue