sb-bsd-sockets: check for MAKE-ALIEN success in GET-PROTOCOL-BY-NAME
[sbcl.git] / tests / deadline.impure.lisp
index 88171e0..9242b3c 100644 (file)
     (assert (= n 1))
     (assert (not final))))
 
-(with-test (:name (:deadline :get-mutex) :skipped-on '(not (and :sb-thread (not :sb-lutex))))
+(with-test (:name (:deadline :get-mutex) :skipped-on '(not :sb-thread))
   (assert-timeout
    (let ((lock (sb-thread:make-mutex))
-        (waitp t))
+         (waitp t))
      (sb-thread:make-thread (lambda ()
-                             (sb-thread:get-mutex lock)
-                             (setf waitp nil)
-                             (sleep 5)))
+                              (sb-thread:get-mutex lock)
+                              (setf waitp nil)
+                              (sleep 5)))
      (loop while waitp do (sleep 0.01))
      (sb-sys:with-deadline (:seconds 1)
        (sb-thread:get-mutex lock)))))
 
-(with-test (:name (:deadline :wait-on-semaphore) :skipped-on '(not (and :sb-thread (not :sb-lutex))))
+(with-test (:name (:deadline :wait-on-semaphore) :skipped-on '(not :sb-thread))
   (assert-timeout
    (let ((sem (sb-thread::make-semaphore :count 0)))
      (sb-sys:with-deadline (:seconds 1)
        (sb-thread::wait-on-semaphore sem)))))
 
-(with-test (:name (:deadline :join-thread) :skipped-on '(not (and :sb-thread (not :sb-lutex))))
+(with-test (:name (:deadline :join-thread) :skipped-on '(not :sb-thread))
   (assert-timeout
    (sb-sys:with-deadline (:seconds 1)
      (sb-thread:join-thread
       (sb-thread:make-thread (lambda () (loop (sleep 1))))))))
 
-(with-test (:name (:deadline :futex-wait-eintr) :skipped-on '(not (and :sb-thread (not :sb-lutex))))
+(with-test (:name (:deadline :futex-wait-eintr) :skipped-on '(not :sb-thread))
   (let ((lock (sb-thread:make-mutex))
-       (waitp t))
+        (waitp t))
     (sb-thread:make-thread (lambda ()
-                            (sb-thread:get-mutex lock)
-                            (setf waitp nil)
-                            (sleep 5)))
+                             (sb-thread:get-mutex lock)
+                             (setf waitp nil)
+                             (sleep 5)))
     (loop while waitp do (sleep 0.01))
     (let ((thread (sb-thread:make-thread
-                  (lambda ()
-                    (let ((start (get-internal-real-time)))
-                      (handler-case
-                          (sb-sys:with-deadline (:seconds 1)
-                            (sb-thread:get-mutex lock))
-                        (sb-sys:deadline-timeout (x)
-                          (declare (ignore x))
-                          (let ((end (get-internal-real-time)))
-                            (float (/ (- end start)
-                                      internal-time-units-per-second)
-                                   0.0)))))))))
+                   (lambda ()
+                     (let ((start (get-internal-real-time)))
+                       (handler-case
+                           (sb-sys:with-deadline (:seconds 1)
+                             (sb-thread:get-mutex lock))
+                         (sb-sys:deadline-timeout (x)
+                           (declare (ignore x))
+                           (let ((end (get-internal-real-time)))
+                             (float (/ (- end start)
+                                       internal-time-units-per-second)
+                                    0.0)))))))))
       (sleep 0.3)
       (sb-thread:interrupt-thread thread (lambda () 42))
       (let ((seconds-passed (sb-thread:join-thread thread)))
-       (format t "Deadline in ~S~%" seconds-passed)
-       (assert (< seconds-passed 1.2))))))
+        (format t "Deadline in ~S~%" seconds-passed)
+        (assert (< seconds-passed 1.2))))))