fix bug in semaphore notification objects on TRY-SEMAPHORE
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 1 Dec 2011 09:16:09 +0000 (11:16 +0200)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 1 Dec 2011 16:05:43 +0000 (18:05 +0200)
  It's not notifiction.

src/code/target-thread.lisp
tests/threads.pure.lisp

index 948032b..7ec3309 100644 (file)
@@ -1023,7 +1023,7 @@ the status is set to T."
       (when (not (minusp new-count))
         (setf (semaphore-%count semaphore) new-count)
         (when notification
-          (setf (semaphore-notifiction-%status notification) t))
+          (setf (semaphore-notification-%status notification) t))
         ;; FIXME: We don't actually document this -- should we just
         ;; return T, or document new count as the return?
         new-count))))
index 1545237..adcf13a 100644 (file)
                              :timeout 0.01
                              :default cookie)))))
 
-(with-test (:name :semaphore-notification
+(with-test (:name (:semaphore-notification :wait-on-semaphore)
             :skipped-on '(not :sb-thread))
   (let ((sem (make-semaphore))
         (ok nil)
                            unsafe)))
           (assert (= n (+ k (length safe))))
           (assert unsafe))))))
+
+(with-test (:name (:semaphore-notification :try-sempahore)
+            :skipped-on '(not :sb-thread))
+  (let* ((sem (make-semaphore))
+         (note (make-semaphore-notification)))
+    (try-semaphore sem 1 note)
+    (assert (not (semaphore-notification-status note)))
+    (signal-semaphore sem)
+    (try-semaphore sem 1 note)
+    (assert (semaphore-notification-status note))))