anchor.diff:  
   ;;; Input Protocol Classes
   
  +;; Event queues
  +
  +(defclass standard-event-queue ()
  +  ((lock :initform (make-lock "event queue")
  +         :reader event-queue-lock)
  +   (head :initform nil
  +         :accessor event-queue-head
  +         :documentation "Head pointer of event queue.")
  +   (tail :initform nil
  +         :accessor event-queue-tail
  +         :documentation "Tail pointer of event queue.") ))
  +
  +(defmethod event-queue-read-no-hang ((eq standard-event-queue))
  +  "Reads one event from the queue, if there is no event just return NIL."
  +  (with-lock-held ((event-queue-lock eq))
  +    (let ((res (pop (event-queue-head eq))))
  +      (when (null (event-queue-head eq))
  +        (setf (event-queue-tail eq) nil))
  +      res)))
  +
  +(defmethod event-queue-read ((eq standard-event-queue))
  +  "Reads one event from the queue, if there is no event, hang until here is one."
  +  (loop
  +      (let ((res (event-queue-read-no-hang eq)))
  +        (when res
  +          (return res))
  +        (process-wait  "Waiting for event"
  +                       (lambda ()
  +                         (not (null (event-queue-head eq))))))))
  +
  +(defmethod event-queue-append ((eq standard-event-queue) item)
  +  "Append the item at the end of the queue."
  +  (with-lock-held ((event-queue-lock eq))
  +    (cond ((null (event-queue-tail eq))
  +           (setf (event-queue-head eq) (cons item nil)
  +                 (event-queue-tail eq) (event-queue-head eq)))
  +          (t
  +           (setf (event-queue-tail eq)
  +                 (setf (cdr (event-queue-tail eq)) (cons item nil)))))))
  +
  +(defmethod event-queue-prepend ((eq standard-event-queue) item)
  +  "Prepend the item to the beginning of the queue."
  +  (with-lock-held ((event-queue-lock eq))
  +    (cond ((null (event-queue-tail eq))
  +           (setf (event-queue-head eq) (cons item nil)
  +                 (event-queue-tail eq) (event-queue-head eq)))
  +          (t
  +           (push item (event-queue-head eq))))))
  +
  +(defmethod event-queue-peek-if (predicate (eq standard-event-queue))
  +  "Goes thru the whole event queue an returns the first event, which
  +   satisfies 'predicate' and leaves the event in the queue.
  +   Returns NIL, if there is no such event."
  +  (with-lock-held ((event-queue-lock eq))
  +    (find-if predicate (event-queue-head eq))))
  +
  +(defmethod event-queue-listen ((eq standard-event-queue))
  +  (not (null (event-queue-head eq))))
  +
  +;; STANDARD-SHEET-INPUT-MIXIN
  +
   (defclass standard-sheet-input-mixin ()
  -  ((queue :initform nil)
  +  ((queue :initform (make-instance 'standard-event-queue))
      (port :initform nil
   	 :initarg :port
   	 :reader port)
  
positive.code: ;;; -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
  
  ;;;  (c) copyright 1998,1999,2000 by Michael McDonald (mikemac@mikemac.com)
  
  ;;; This library is free software; you can redistribute it and/or
  ;;; modify it under the terms of the GNU Library General Public
  
negative.code: 
  (defmethod queue-event ((sheet standard-sheet-input-mixin) event)
    (with-slots (queue) sheet
      (event-queue-append queue event)))
    
  (defmethod handle-event ((sheet standard-sheet-input-mixin) event)
    ;; Standard practice is too ignore events
  