anchor.diff:    (check-type thread thread)
     (setf (sys.int::%array-like-ref-t thread +thread-prev+) value))
   
  -(defun thread-inhibit-interrupt (thread)
  -  (check-type thread thread)
  -  (sys.int::%array-like-ref-t thread +thread-inhibit-interrupt+))
  -
  -(defun (setf thread-inhibit-interrupt) (value thread)
  -  (check-type thread thread)
  -  (setf (sys.int::%array-like-ref-t thread +thread-inhibit-interrupt+) value))
  +(defun thread-foothold-disable-depth (thread)
  +  (check-type thread thread)
  +  (sys.int::%array-like-ref-t thread +thread-foothold-disable-depth+))
  +
  +(defun (setf thread-foothold-disable-depth) (value thread)
  +  (check-type thread thread)
  +  (setf (sys.int::%array-like-ref-t thread +thread-foothold-disable-depth+) value))
  +
  +(defun thread-footholds-enabled-p (thread)
  +  (zerop (thread-foothold-disable-depth thread)))
  +
  +(defmacro with-footholds-inhibited (&body body)
  +  "Inhibit thread footholds within body."
  +  (let ((self (gensym "SELF"))
  +        ;; Footholds are active at this point, so another thread may
  +        ;; be able to establish a foothold which unwinds after the unwind-protect
  +        ;; begins, but before with-thread-lock takes the thread lock.
  +        ;; Use a variable to prevent decrementing the disable depth if this occurs.
  +        (have-incremented (gensym)))
  +    `(let ((,self (current-thread))
  +           (,have-incremented nil))
  +       (unwind-protect
  +            (progn
  +              (with-thread-lock (self)
  +                (incf (thread-foothold-disable-depth ,self))
  +                (setf ,have-incremented t))
  +              ,@body)
  +         (when ,have-incremented
  +           (with-thread-lock (self)
  +             (decf (thread-foothold-disable-depth ,self)))
  +           (when (zerop (thread-foothold-disable-depth ,self))
  +             (establish-deferred-footholds ,self)))))))
  +
  +(defmacro with-footholds-permitted (&body body)
  +  "Permit thread footholds within body.
  +Must only appear within the dynamic extent of a WITH-FOOTHOLDS-INHIBITED form."
  +  (let ((self (gensym "SELF")))
  +    `(let ((,self (current-thread)))
  +       ;; Footholds are initially inhibited, no need for a protection variable.
  +       (unwind-protect
  +            (progn
  +              (with-thread-lock (self)
  +                (assert (not (zerop (thread-foothold-disable-depth ,self))))
  +                (decf (thread-foothold-disable-depth ,self)))
  +              ;; Establish any deferred footholds.
  +              (when (zerop (thread-foothold-disable-depth ,self))
  +                (establish-deferred-footholds ,self))
  +              ,@body)
  +         (with-thread-lock (self)
  +           (incf (thread-foothold-disable-depth ,self)))))))
   
   (defmacro with-thread-lock ((thread) &body body)
     (let ((sym (gensym "thread")))
  
positive.code: ;;    Forward link to the next thread in whatever list the thread is in.
  ;; 10 prev
  ;;    Backward link to the previous thread in whatever list the thread is in.
  ;; 11 inhibit-interrupt
  ;;    When true, prevent INTERRUPT-THREAD from interrupting the thread.
  ;;    DESTROY-THREAD will also be unable to destroy the thread unless the abort option is set.
  ;; 32-127 MV slots
  ;;    Slots used as part of the multiple-value return convention.
  
negative.code:                   ;; todo: SMP.
                    (:active (error "what?"))
                    (:runnable
                     ;; Wait for the thread to allow footholds.
                     (do ()
                         ((thread-footholds-enabled-p thread))
                       ;; Drop the lock & reschedule.
                       (%unlock-thread thread)
                       (sys.int::%sti)
  