Commits

Moritz Heidkamp  committed c607150

make `channel-enqueue!` require at least one message argument

  • Participants
  • Parent commits 34f017a

Comments (0)

Files changed (1)

         (lambda ()
           (mutex-unlock! mutex)))))
 
-(define (channel-enqueue! channel . messages)
+(define (channel-enqueue! channel message . messages)
   (and (not (channel-closed? channel))
        (let ((queue (channel-queue channel))
-             (mutex (channel-mutex channel)))
+             (mutex (channel-mutex channel))
+             (messages (cons message messages)))
          (mutex-lock! mutex)
-         (queue-add-list! (channel-queue channel) messages)
+         (queue-add-list! queue messages)
          (set! (channel-forks channel)
                (filter (lambda (fork)
                          (and-let* ((fork (locative->object fork)))