X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fthreads.impure.lisp;h=8bd9f19084ef0434f8c72f468224c09390e29d6e;hb=097bb4b229c78120a1cf3771b1d0cdca31a93101;hp=75bb628c7b3b57037d98611943cd7371c812f3a5;hpb=b56c1a4dc22aa0ac827343667584aa6090b15f02;p=sbcl.git diff --git a/tests/threads.impure.lisp b/tests/threads.impure.lisp index 75bb628..8bd9f19 100644 --- a/tests/threads.impure.lisp +++ b/tests/threads.impure.lisp @@ -528,8 +528,7 @@ (defun alloc-stuff () (copy-list '(1 2 3 4 5))) -(with-test (:name (:interrupt-thread :interrupt-consing-child) - :broken-on :darwin) +(with-test (:name (:interrupt-thread :interrupt-consing-child)) (let ((thread (sb-thread:make-thread (lambda () (loop (alloc-stuff)))))) (let ((killers (loop repeat 4 collect @@ -1042,8 +1041,7 @@ ;;; Make sure that a deadline handler is not invoked twice in a row in ;;; CONDITION-WAIT. See LP #512914 for a detailed explanation. ;;; -(with-test (:name (:condition-wait :deadlines :LP-512914) - :skipped-on '(not :sb-futex)) +(with-test (:name (:condition-wait :deadlines :LP-512914)) (let ((n 2) ; was empirically enough to trigger the bug (mutex (sb-thread:make-mutex)) (waitq (sb-thread:make-waitqueue)) @@ -1193,9 +1191,7 @@ (format t "~&starting gc deadlock test: WARNING: THIS TEST WILL HANG ON FAILURE!~%") -(with-test (:name :gc-deadlock - ;; Prone to hang on Darwin due to interrupt issues. - :broken-on :darwin) +(with-test (:name :gc-deadlock) ;; Prior to 0.9.16.46 thread exit potentially deadlocked the ;; GC due to *all-threads-lock* and session lock. On earlier ;; versions and at least on one specific box this test is good enough @@ -1407,3 +1403,26 @@ (let ((res (list (sb-thread:join-thread t1) (sb-thread:join-thread t2)))) (assert (equal '(:ok :ok) res))))) + +(with-test (:name :spinlock-api) + (let* ((warned 0) + (funs + (handler-bind ((sb-int:early-deprecation-warning (lambda (_) + (declare (ignore _)) + (incf warned)))) + (list (compile nil `(lambda (lock) + (sb-thread::with-spinlock (lock) + t))) + (compile nil `(lambda () + (sb-thread::make-spinlock :name "foo"))) + (compile nil `(lambda (lock) + (sb-thread::get-spinlock lock))) + (compile nil `(lambda (lock) + (sb-thread::release-spinlock lock))))))) + (assert (eql 4 warned)) + (handler-bind ((warning #'error)) + (destructuring-bind (with make get release) funs + (let ((lock (funcall make))) + (funcall get lock) + (funcall release lock) + (assert (eq t (funcall with lock))))))))