anchor.diff:  (defmacro define-update-task-count (name op)
     `(defun/type ,name (kernel delta) (kernel fixnum) t
        (declare #.*full-optimize*)
  -     (with-lock-held ((lock (optimizer-data kernel)))
  +     (with-lock-held ((task-counter-lock (task-counter kernel)))
          (,op kernel delta))))
   
   (define-update-task-count update-task-count    update-task-count/no-lock)
  
positive.code:                 ,@body))
              (defun/wrapper ,name ,(unchecked-name name) ,params
                ,@(unsplice docstring)
                (let ((kernel (check-kernel)))
                  (,',call-impl kernel)))
              (eval-when (:load-toplevel :execute)
                (register-fn ',name))
              ',name)))))
  
  (defmacro call-impl-in-worker (kernel)
    (with-gensyms (worker channel)
      `(let ((,worker *worker*))
         (if ,worker
  
negative.code: (defmacro define-update-task-count/no-lock (name op)
    `(defun/type ,name (kernel delta) (kernel fixnum) t
       (declare #.*full-optimize*)
       (with-optimizer-slots ((accept-task-p optimizer-flag)
                              (task-counter optimizer-data)) kernel
         (with-task-counter-slots (count) task-counter
           (incf count delta)
           ;; `<=' returns generalized boolean
           (setf accept-task-p
                 (to-boolean (<= count (the fixnum (,op kernel)))))))))
  
  (macrolet ((n-workers   (k) `(%kernel-worker-count ,k))
  