summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-08-31 10:47:03 +0200
committerMichael Albinus <michael.albinus@gmx.de>2018-08-31 10:47:03 +0200
commitac7936cb8f4d4d6706535bfcea0d97741c2ca15f (patch)
tree3399f9b5994fda2d8d6254985032803bf5958700 /test/src
parent3d09d533d15eae2974f3858df43746cf6e8f897b (diff)
downloademacs-ac7936cb8f4d4d6706535bfcea0d97741c2ca15f.tar.gz
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/src')
-rw-r--r--test/src/thread-tests.el16
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 @@
(declare-function mutex-lock "thread.c" (mutex))
(declare-function mutex-unlock "thread.c" (mutex))
(declare-function thread--blocker "thread.c" (thread))
-(declare-function thread-alive-p "thread.c" (thread))
+(declare-function thread-live-p "thread.c" (thread))
(declare-function thread-join "thread.c" (thread))
(declare-function thread-last-error "thread.c" ())
(declare-function thread-name "thread.c" (thread))
@@ -60,11 +60,11 @@
(should
(string= "hi bob" (thread-name (make-thread #'ignore "hi bob")))))
-(ert-deftest threads-alive ()
+(ert-deftest threads-live ()
"Test for thread liveness."
(skip-unless (featurep 'threads))
(should
- (thread-alive-p (make-thread #'ignore))))
+ (thread-live-p (make-thread #'ignore))))
(ert-deftest threads-all-threads ()
"Simple test for all-threads."
@@ -96,7 +96,7 @@
(let ((thread (make-thread #'threads-test-thread1)))
(thread-join thread)
(and threads-test-global
- (not (thread-alive-p thread)))))))
+ (not (thread-live-p thread)))))))
(ert-deftest threads-join-self ()
"Cannot `thread-join' the current thread."
@@ -271,7 +271,7 @@
(let (th1 th2)
(setq th1 (make-thread #'threads-call-error "call-error"))
(should (threadp th1))
- (while (thread-alive-p th1)
+ (while (thread-live-p th1)
(thread-yield))
(should (equal (thread-last-error)
'(error "Error is called")))
@@ -297,7 +297,7 @@
(while t (thread-yield))))))
(thread-signal thread 'error nil)
(sit-for 1)
- (should-not (thread-alive-p thread))
+ (should-not (thread-live-p thread))
(should (equal (thread-last-error) '(error)))))
(defvar threads-condvar nil)
@@ -323,7 +323,7 @@
(setq new-thread (make-thread #'threads-test-condvar-wait))
;; Make sure new-thread is alive.
- (should (thread-alive-p new-thread))
+ (should (thread-live-p new-thread))
(should (= (length (all-threads)) 2))
;; Wait for new-thread to become blocked on the condvar.
(while (not (eq (thread--blocker new-thread) threads-condvar))
@@ -336,7 +336,7 @@
(sleep-for 0.1)
;; Make sure the thread is still there. This used to fail due to
;; a bug in thread.c:condition_wait_callback.
- (should (thread-alive-p new-thread))
+ (should (thread-live-p new-thread))
(should (= (length (all-threads)) 2))
(should (eq (thread--blocker new-thread) threads-condvar))