anchor.diff:  
   (defun set-timer (fn time &optional new-thread)
     (ensure-timer-thread)
  +  (cv-wait (timer-fair-cv *timer*)
  +	   (lambda ()
  +	     (and (> (get-internal-real-time)
  +		     (+ (timer-last-time *timer*)
  +			(secs2i .0001)))
  +		  (zerop (cv-count *current-cv*)))))
     (let ((event (make-timer-event
   		:fn fn
   		:thread (unless new-thread (current-thread))
   		:time (+ (secs2i time)
   			 (get-internal-real-time)))))
  -    (qpush (timer-queue *timer*) event)
  -    (timer-notify)
  -    (interrupt-thread (timer-thread *timer*) #'%int-thrower)
  -    (sleep 0)
  -    event))
  +    (multiple-value-bind (ign node)
  +	(qpush (timer-queue *timer*) event)
  +      (declare (ignore ign))
  +      (cv-notify (timer-empty-cv *timer*))
  +      (interrupt-thread (timer-thread *timer*) #'%int-thrower)
  +      (values event node))))
   
   ;;; ----------------------------------------------------------------------------
   
   (defun remove-timer (timer)
     (ensure-timer-thread)
     (let ((node
  -	 (block search
  -	   (queue-find (timer-queue *timer*)
  -		       (lambda (x)
  -			 (when (eq x timer)
  -			   (return-from search *current-queue-node*)))))))
  +	 (if (queue-node-p timer)
  +	     timer
  +	     (block search
  +	       (queue-find (timer-queue *timer*)
  +			   (lambda (x)
  +			     (when (eq x timer)
  +			       (return-from search
  +				 *current-queue-node*))))))))
         (when node
   	(queue-delete (timer-queue *timer*) node)
   	timer)))
  
positive.code:   (values (floor (* (coerce x 'double-float)
  		    #.(coerce internal-time-units-per-second 'double-float)))))
  
  ;;; ----------------------------------------------------------------------------
  
  (defun timer-wait (&optional (tm *timer*))
    (when tm
      (let ((cv (timer-cv tm))
  	  (cvl (timer-cv-lock tm)))
        (with-lock-held (cvl)
  	(incf (timer-cv-wait tm))
  	(when (plusp (timer-cv-wait tm))
  	  (condition-wait cv cvl))))))
  
  ;;; ----------------------------------------------------------------------------
  
  (defun timer-notify (&optional (tm *timer*))
    (when tm
      (let ((cv (timer-cv tm))
  	  (cvl (timer-cv-lock tm)))
        (with-lock-held (cvl)
  	(unwind-protect
  	     (decf (timer-cv-wait tm))
  	  (unless (minusp (timer-cv-wait tm))
  	    (condition-notify cv)))))))
  
  ;;;
  ;;; Timer definitions
  
negative.code:   (when (or force (not *timer*))
      (setf *timer*
  	  (make-timer 
  	   :empty-cv (make-cv)
  	   :fair-cv (make-cv 
  		     :accum t
  		     :accum-max 1
  		     :notified 1)
  	   :last-time 0
  	   :queue (make-queue :type 'priority-cqueue
  			      :compare (lambda (x y)
  					 (< (timer-event-time x)
  					    (timer-event-time y)))))
  	  (timer-thread *timer*) (make-thread #'timer-handling))
      t))
  
  ;;; ----------------------------------------------------------------------------
  