diff options
| author | Michael Albinus | 2018-08-31 10:47:03 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-08-31 10:47:03 +0200 |
| commit | ac7936cb8f4d4d6706535bfcea0d97741c2ca15f (patch) | |
| tree | 3399f9b5994fda2d8d6254985032803bf5958700 /test | |
| parent | 3d09d533d15eae2974f3858df43746cf6e8f897b (diff) | |
| download | emacs-ac7936cb8f4d4d6706535bfcea0d97741c2ca15f.tar.gz emacs-ac7936cb8f4d4d6706535bfcea0d97741c2ca15f.zip | |
Rename thread-alive-p to thread-live-p
* 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'.
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/thread-tests.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el index a00a9c84bd6..e721e0f9621 100644 --- a/test/src/thread-tests.el +++ b/test/src/thread-tests.el | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | (declare-function mutex-lock "thread.c" (mutex)) | 32 | (declare-function mutex-lock "thread.c" (mutex)) |
| 33 | (declare-function mutex-unlock "thread.c" (mutex)) | 33 | (declare-function mutex-unlock "thread.c" (mutex)) |
| 34 | (declare-function thread--blocker "thread.c" (thread)) | 34 | (declare-function thread--blocker "thread.c" (thread)) |
| 35 | (declare-function thread-alive-p "thread.c" (thread)) | 35 | (declare-function thread-live-p "thread.c" (thread)) |
| 36 | (declare-function thread-join "thread.c" (thread)) | 36 | (declare-function thread-join "thread.c" (thread)) |
| 37 | (declare-function thread-last-error "thread.c" ()) | 37 | (declare-function thread-last-error "thread.c" ()) |
| 38 | (declare-function thread-name "thread.c" (thread)) | 38 | (declare-function thread-name "thread.c" (thread)) |
| @@ -60,11 +60,11 @@ | |||
| 60 | (should | 60 | (should |
| 61 | (string= "hi bob" (thread-name (make-thread #'ignore "hi bob"))))) | 61 | (string= "hi bob" (thread-name (make-thread #'ignore "hi bob"))))) |
| 62 | 62 | ||
| 63 | (ert-deftest threads-alive () | 63 | (ert-deftest threads-live () |
| 64 | "Test for thread liveness." | 64 | "Test for thread liveness." |
| 65 | (skip-unless (featurep 'threads)) | 65 | (skip-unless (featurep 'threads)) |
| 66 | (should | 66 | (should |
| 67 | (thread-alive-p (make-thread #'ignore)))) | 67 | (thread-live-p (make-thread #'ignore)))) |
| 68 | 68 | ||
| 69 | (ert-deftest threads-all-threads () | 69 | (ert-deftest threads-all-threads () |
| 70 | "Simple test for all-threads." | 70 | "Simple test for all-threads." |
| @@ -96,7 +96,7 @@ | |||
| 96 | (let ((thread (make-thread #'threads-test-thread1))) | 96 | (let ((thread (make-thread #'threads-test-thread1))) |
| 97 | (thread-join thread) | 97 | (thread-join thread) |
| 98 | (and threads-test-global | 98 | (and threads-test-global |
| 99 | (not (thread-alive-p thread))))))) | 99 | (not (thread-live-p thread))))))) |
| 100 | 100 | ||
| 101 | (ert-deftest threads-join-self () | 101 | (ert-deftest threads-join-self () |
| 102 | "Cannot `thread-join' the current thread." | 102 | "Cannot `thread-join' the current thread." |
| @@ -271,7 +271,7 @@ | |||
| 271 | (let (th1 th2) | 271 | (let (th1 th2) |
| 272 | (setq th1 (make-thread #'threads-call-error "call-error")) | 272 | (setq th1 (make-thread #'threads-call-error "call-error")) |
| 273 | (should (threadp th1)) | 273 | (should (threadp th1)) |
| 274 | (while (thread-alive-p th1) | 274 | (while (thread-live-p th1) |
| 275 | (thread-yield)) | 275 | (thread-yield)) |
| 276 | (should (equal (thread-last-error) | 276 | (should (equal (thread-last-error) |
| 277 | '(error "Error is called"))) | 277 | '(error "Error is called"))) |
| @@ -297,7 +297,7 @@ | |||
| 297 | (while t (thread-yield)))))) | 297 | (while t (thread-yield)))))) |
| 298 | (thread-signal thread 'error nil) | 298 | (thread-signal thread 'error nil) |
| 299 | (sit-for 1) | 299 | (sit-for 1) |
| 300 | (should-not (thread-alive-p thread)) | 300 | (should-not (thread-live-p thread)) |
| 301 | (should (equal (thread-last-error) '(error))))) | 301 | (should (equal (thread-last-error) '(error))))) |
| 302 | 302 | ||
| 303 | (defvar threads-condvar nil) | 303 | (defvar threads-condvar nil) |
| @@ -323,7 +323,7 @@ | |||
| 323 | (setq new-thread (make-thread #'threads-test-condvar-wait)) | 323 | (setq new-thread (make-thread #'threads-test-condvar-wait)) |
| 324 | 324 | ||
| 325 | ;; Make sure new-thread is alive. | 325 | ;; Make sure new-thread is alive. |
| 326 | (should (thread-alive-p new-thread)) | 326 | (should (thread-live-p new-thread)) |
| 327 | (should (= (length (all-threads)) 2)) | 327 | (should (= (length (all-threads)) 2)) |
| 328 | ;; Wait for new-thread to become blocked on the condvar. | 328 | ;; Wait for new-thread to become blocked on the condvar. |
| 329 | (while (not (eq (thread--blocker new-thread) threads-condvar)) | 329 | (while (not (eq (thread--blocker new-thread) threads-condvar)) |
| @@ -336,7 +336,7 @@ | |||
| 336 | (sleep-for 0.1) | 336 | (sleep-for 0.1) |
| 337 | ;; Make sure the thread is still there. This used to fail due to | 337 | ;; Make sure the thread is still there. This used to fail due to |
| 338 | ;; a bug in thread.c:condition_wait_callback. | 338 | ;; a bug in thread.c:condition_wait_callback. |
| 339 | (should (thread-alive-p new-thread)) | 339 | (should (thread-live-p new-thread)) |
| 340 | (should (= (length (all-threads)) 2)) | 340 | (should (= (length (all-threads)) 2)) |
| 341 | (should (eq (thread--blocker new-thread) threads-condvar)) | 341 | (should (eq (thread--blocker new-thread) threads-condvar)) |
| 342 | 342 | ||