Debugging scheduler.
[sam.git] / fifo.scm
index ab5eda0..14b24f1 100644 (file)
--- a/fifo.scm
+++ b/fifo.scm
@@ -2,6 +2,7 @@
     (make-fifo
      fifo-push
      fifo-pop
+     fifo-empty?
      fifo->list)
 
   (import scheme
@@ -38,6 +39,7 @@
                  (set! head '())
                  (set-cell-next! tail '()))
              (cell-val old-tail)))
+          ((empty?) (null? head))
           ((->list)
            (let loop ((this-cell head))
              (if (null? this-cell)
@@ -51,5 +53,8 @@
   (define (fifo-pop fifo)
     (fifo 'pop))
 
+  (define (fifo-empty? fifo)
+    (fifo 'empty?))
+
   (define (fifo->list fifo)
     (fifo '->list)))