summaryrefslogtreecommitdiff
path: root/test/src/thread-tests.el
Commit message (Collapse)AuthorAge
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* ; Fix typosStefan Kangas2022-11-18
|
* Rewrite thread context switch code (bug#48990)Stefan Monnier2022-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the context switch code handle buffer-local variables more correctly by reusing the code originally written for `backtrace-eval`. This has the side benefit of making the `saved_value` field unused. * src/lisp.h (enum specbind_tag): Remove `saved_value` field. (rebind_for_thread_switch, unbind_for_thread_switch): Delete decls. (specpdl_unrewind): Declare function. * src/eval.c (specpdl_saved_value): Delete function. (specbind): Delete the code related to `saved_value`, and consolidate common code between the different branches. (rebind_for_thread_switch, -unbind_for_thread_switch): Move to `thread.c`. (specpdl_unrewind): New function, extracted from `backtrace_eval_unrewind`. Use `SET_INTERNAL_THREAD_SWITCH`. Skip the buffer & excursion unwinds depending on new arg `vars_only`. (backtrace_eval_unrewind): Use it. (mark_specpdl): Don't mark `saved_value`. * src/thread.c (rebind_for_thread_switch, unbind_for_thread_switch): Move from `eval.c` and rewrite using `specpdl_unrewind`. * test/src/thread-tests.el (threads-test-bug48990): New test. * test/Makefile.in (test_template): Add a + as suggested by make: "warning: jobserver unavailable: using -j1. Add '+' to parent make rule".
* Merge from origin/emacs-28Eli Zaretskii2022-01-01
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
| |
* | Fix some tests in --without-all buildsStefan Kangas2021-12-21
|/ | | | | | | * test/lisp/image-tests.el (image-type/from-filename): * test/src/image-tests.el (image-tests-init-image-library): * test/src/thread-tests.el (threads-test-bug33073): Fix tests in --without-all builds.
* ; Minor stylistic checkdoc fixes in test/**/*.elStefan Kangas2021-09-26
|
* ; Normalize and add missing first and last linesStefan Kangas2021-04-19
|
* Remove redundant #' before lambda in testsStefan Kangas2021-04-04
| | | | | | | | | | | | | | * test/lisp/electric-tests.el (save-electric-modes) (inhibit-in-mismatched-string-inside-ruby-comments) (inhibit-in-mismatched-string-inside-c-comments, js-mode-braces) (js-mode-braces-with-layout) (js-mode-braces-with-layout-and-indent, autowrapping-1) (autowrapping-2, autowrapping-3, autowrapping-4, autowrapping-5) (autowrapping-6, autowrapping-7): * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-relative-to-project-root): * test/src/thread-tests.el (threads-signal-early) (threads-signal-main-thread): Remove redundant #' before lambda.
* Update copyright year to 2021Paul Eggert2021-01-01
| | | | Run "TZ=UTC0 admin/update-copyright".
* Use lexical-binding in most src testsStefan Kangas2020-04-24
| | | | | | | | | | | | | | | | | | | | * test/src/charset-tests.el: * test/src/chartab-tests.el: * test/src/cmds-tests.el: * test/src/coding-tests.el (top-level) (generate-ascii-file, generate-mostly-nonascii-file): * test/src/doc-tests.el: * test/src/floatfns-tests.el: * test/src/font-tests.el: * test/src/keymap-tests.el: * test/src/process-tests.el (top-level) (process-test-sentinel-wait-function-working-p) (process-test-stderr-buffer, process-test-stderr-filter): * test/src/textprop-tests.el: * test/src/thread-tests.el: * test/src/timefns-tests.el: * test/src/undo-tests.el: * test/src/xml-tests.el: Use lexical-binding.
* ; Fix some typos and doc issues (bug#40695)Štěpán Němec2020-04-18
|
* Update copyright year to 2020Paul Eggert2020-01-01
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Merge from origin/emacs-26Paul Eggert2018-12-31
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-01
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Avoid assertion violation when comparing with main-threadEli Zaretskii2018-10-17
| | | | | | | | | | | | | | | | | | * src/thread.c (unmark_main_thread): New function. * src/lisp.h (unmark_main_thread): Prototype it. * src/alloc.c (garbage_collect_1): Call it after sweeping. (Bug#33073) * test/src/thread-tests.el (threads-test-bug33073): New test.
* | Mark thread-alive-p as obsoleteMichael Albinus2018-08-31
| | | | | | | | | | | | | | | | * etc/NEWS (thread-alive-p): * lisp/emacs-lisp/thread.el (thread-alive-p): Mark it as obsolete. * test/src/thread-tests.el (threads-join-error) (threads-signal-main-thread): Use `thread-live-p'.
* | Merge from origin/emacs-26Michael Albinus2018-08-31
|\| | | | | | | | | | | ac7936cb8f Rename thread-alive-p to thread-live-p 3d09d533d1 rcirc: Document /reconnect as a built-in command (Bug#29656) a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test.
| * Rename thread-alive-p to thread-live-pMichael Albinus2018-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/threads.texi (Basic Thread Functions): Use thread-live-p. * etc/NEWS: 'thread-alive-p' has been renamed to 'thread-live-p'. * src/thread.c (thread_live_p): Rename from thread_alive_p. Adapt all callees. (Fthread_live_p): Rename from Fthread_alive_p. (syms_of_threads): Make thread-alive-p an alias of thread-live-p. * test/src/thread-tests.el (all): Replace `thread-alive-p' by `thread-live-p'. (threads-live): Rename from `threads-alive'.
* | Handle thread-signal towards the main thread (Bug#32502)Michael Albinus2018-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/threads.texi (Basic Thread Functions): * etc/NEWS: Document thread-signal towards the main thread. * lisp/emacs-lisp/thread.el: New package. * src/keyboard.c (read_char): Check for Qthread_event. (kbd_buffer_get_event, make_lispy_event): Handle THREAD_EVENT. (syms_of_keyboard): Declare Qthread_event. (keys_of_keyboard): Add thread-handle-event to special-event-map. * src/termhooks.h (enum event_kind): Add THREAD_EVENT. * src/thread.c: Include "keyboard.h". (poll_suppress_count) Don't declare extern. (Fthread_signal): Raise event if THREAD is the main thread. (Bug#32502) * test/src/thread-tests.el (thread): Require it. (threads-signal-main-thread): New test.
* | thread-join returns the result of finished threadMichael Albinus2018-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Add variable main-thread, fix Bug#32169Michael Albinus2018-07-17
|/ | | | | | | | | | | | | | | | * doc/lispref/threads.texi (Basic Thread Functions): Add example, how to propagate signals to the main thread. Describe variable `main-thread'. Document optional argument CLEANUP of `thread-last-error'. * src/thread.c (Fthread_last_error): Add optional argument CLEANUP. (Bug#32169) (main-thread): New defvar. * test/src/thread-tests.el (thread-last-error): Adapt declaration. (main-thread): Declare. (threads-main-thread): New test. (threads-errors): Extend test.
* Use consistent function names in thread-tests.elMichael Albinus2018-07-13
| | | | | | * test/src/thread-tests.el (threads-call-error, threads-custom) (threads-errors, threads-sticky-point, threads-signal-early): Rename, using naming convention to prefix with "threads-".
* Provide feature 'threadsMichael Albinus2018-07-12
| | | | | | | * src/thread.c (syms_of_threads): Provide feature "threads". * test/src/thread-tests.el (top): Declare the functions. (all): Use (featurep 'threads) check.
* Add some test skip conditionsGlenn Morris2018-01-17
| | | | | | * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726) (vc-bzr-test-bug9781): Skip if bzr is faulty. * test/src/thread-tests.el: Skip if not compiled with threads.
* Update copyright year to 2018Paul Eggert2018-01-01
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-13
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Rudimentary error handling for non-main threadsEli Zaretskii2017-01-18
| | | | | | | | | | | | | | * src/thread.c (last_thread_error): New static variable. (syms_of_threads): Staticpro it. (record_thread_error, Fthread_last_error): New functions. (syms_of_threads): Defsubr Fthread_last_error. * doc/lispref/threads.texi (Basic Thread Functions): Document thread-last-error. * test/src/thread-tests.el (thread-errors, thread-signal-early) (threads-condvar-wait): Test the values returned by thread-last-error.
* Fix last changeEli Zaretskii2017-01-13
| | | | | | * test/src/thread-tests.el (threads-condvar-wait): Revert previous change. Make sure no other threads from previous tests are running, to avoid interfering with our thread counts.
* Fix the new condvar testEli Zaretskii2017-01-13
| | | | | | * test/src/thread-tests.el (threads-condvar-wait): Enlarge the time we sleep in the main thread to let the other thread process notifications.
* Minor improvements in the new condvar testEli Zaretskii2017-01-13
| | | | | | | | * test/src/thread-tests.el (threads-test-condvar-wait): Use with-mutex instead of emulating it inline. (threads-condvar-wait): Improve comments. Check that the new thread is alive before waiting for it to become blocked on the conditional variable.
* Fix a bug in waiting for condition variableEli Zaretskii2017-01-13
| | | | | | | | | | | * src/thread.c (lisp_mutex_lock, lisp_mutex_unlock) (lisp_mutex_unlock_for_wait, condition_wait_callback) (condition_notify_callback): Improve commentary. (condition_wait_callback): Call post_acquire_global_lock before attempting to lock the mutex, to make sure the lock's owner is recorded correctly. * test/src/thread-tests.el (threads-condvar-wait): New test.
* Update copyright year to 2017 in masterPaul Eggert2017-01-01
| | | | | | Run admin/update-copyright in the master branch. This fixes files that were not already fixed in the emacs-25 branch before it was merged here.
* ; Spelling fixesPaul Eggert2016-12-22
|
* Avoid crashing if a new thread is signaled right awayEli Zaretskii2016-12-12
| | | | | | | | | | | * src/thread.c (post_acquire_global_lock): Don't raise the pending signal if the thread's handlers were not yet set up, as that will cause Emacs to exit with a fatal error. This can happen if a thread is signaled as soon as make-thread returns, before the new thread had an opportunity to acquire the global lock, set up the handlers, and call the thread function. * test/src/thread-tests.el (thread-signal-early): New test.
* Fix point motion in cloned buffersEli Zaretskii2016-12-12
| | | | | | | | | | | | | | | | | | * src/thread.c (post_acquire_global_lock): Call set_buffer_internal_2 instead of tricking set_buffer_internal_1 into resetting the current buffer even if it didn't change. This avoids bug#25165, caused by failing to record the modified values of point and mark, because current_buffer was set to NULL. Also, don't bother re-setting the buffer if there was no thread switch, as that just wastes cycles. * src/buffer.c (set_buffer_internal_2): New function, with most of the body of set_buffer_internal_1, but without the test for B being identical to the current buffer. (set_buffer_internal_1): Call set_buffer_internal_2 if B is not identical to the current buffer. * src/buffer.h (set_buffer_internal_2): Add prototype. * test/src/thread-tests.el (thread-sticky-point): New test.
* Avoid aborts when a thread signals an errorEli Zaretskii2016-12-11
| | | | | | | | | | | | * src/thread.h (struct thread_state): Add members m_waiting_for_input and m_input_available_clear_time. (waiting_for_input, input_available_clear_time): New macros. * src/keyboard.c (waiting_for_input, input_available_clear_time): Remove; they are now macros that reference the current thread. (Bug#25171) * src/w32select.c: Don't include keyboard.h. * test/src/thread-tests.el (thread-errors): New test.
* ; Fix copyright years in new filesGlenn Morris2016-12-10
|
* Fix the test suiteEli Zaretskii2016-12-06
* test/automated/bindings.el: Contents moved to test/src/data-tests.el. * test/automated/threads.el: Moved to test/src/thread-tests.el.