anchor.diff:        (cffi:with-foreign-pointer (buf size)
           (setf (cffi:mem-ref buf :long-long) request-index)
           (iolib.syscalls:write (async-connection/cmd-fd async-conn) buf size))
  -      (log:trace "Request index ~s sent to server, waiting for gate to open" request-index)
         (bordeaux-threads:with-lock-held (b-lock)
           (loop
  -           do (log:trace "Still waiting for gate to open, current index is: ~s" b-current)
              until (eql b-current request-index)
              do (bordeaux-threads:condition-wait b-condvar b-lock)))
  -      (log:trace "Gate opened, proceeding to do stuff")
         (unwind-protect
              (funcall fn)
  -        (log:trace "Stuff is done, updating current and notify server that the gate is closed")
           (bordeaux-threads:with-lock-held (b-lock)
  -          (log:trace "managed to get lock so that we can notify the server")
             (setf b-current nil)
             (bordeaux-threads:condition-notify b-condvar))))))
   
  
positive.code:           (index (1- (async-channel/channel async-channel))))
        (assert (not (null (aref channels index))))
        (setf (aref channels index) nil)))
    (call-close-callbacks async-channel)
    (log:trace "Channel marked as closed: ~s" async-channel))
  
  (defun close-channel (async-channel &key code)
    (when (async-channel/close-p async-channel)
  
negative.code:                    (b-current async-connection/b-current))
        async-conn
      (let ((request-index (load-integer-from-fd (async-connection/cmd-fd-reader async-conn))))
        (if request-index
            (bordeaux-threads:with-lock-held (b-lock)
              (when b-current
                (error "The current handler index is not NIL: ~s" b-current))
              (setf b-current request-index)
              (bordeaux-threads:condition-notify b-condvar)
              (loop
                 while b-current
                 do (bordeaux-threads:condition-wait b-condvar b-lock)))
            ;; ELSE: When index is NIL, the connection should be stopped
            (signal 'stop-connection)))))
  
  