(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))))
: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))))