0.9.1.60:
[sbcl.git] / tests / threads.impure.lisp
index 858d3da..41782bf 100644 (file)
   (assert (eql (mutex-lock l) 0)  nil "6")
   (describe l))
 
+(let ((l (make-waitqueue :name "spinlock"))
+      (p (current-thread-id)))
+  (assert (eql (waitqueue-lock l) 0) nil "1")
+  (with-spinlock (l)
+    (assert (eql (waitqueue-lock l) p) nil "2"))
+  (assert (eql (waitqueue-lock l) 0) nil "3")
+  (describe l))
+
 ;; test that SLEEP actually sleeps for at least the given time, even
 ;; if interrupted by another thread exiting/a gc/anything
 (let ((start-time (get-universal-time)))