anchor.diff:    (sys.lap-x86:ret))
   
   (defun establish-deferred-footholds (thread)
  -  (declare (ignore thread)))
  +  (declare (ignore self)))
   
   (defun establish-thread-foothold (thread function)
     (cond ((eql thread (current-thread))
  
positive.code:     ;; TODO: Track how many spin mutexes are currently taken and assert when
      ;; count != 1.
      (:spin (assert (mutex-%lock mutex))))
    (let ((self (current-thread)))
      (with-footholds-inhibited
          (sys.int::%cli)
        (lock-wait-queue condition-variable)
        (%lock-thread self)
        ;; Attach to the list.
        (push-wait-queue self condition-variable)
        ;; Drop the mutex.
        (release-mutex lock)
        ;; Sleep.
        ;; todo: reenable footholds when the thread is sleeping, but only one level.
        ;; need to be careful with that, returning or unwinding from condition-wait
  
negative.code: ;; The idle thread is not a true thread. It does not appear in all-threads, nor in any run-queue.
  ;; When the machine boots, one idle thread is created for each core. When a core is idle, the
  ;; idle thread will be run.
  ;; FIXME: SMP-safety.
  (defun idle-thread ()
    (loop
       (sys.int::%cli)
       ;; Look for a thread to switch to.
       (let ((next (with-symbol-spinlock (*global-thread-lock*)
                     (pop-run-queue))))
         (cond (next
                ;; Switch to thread.
                (%lock-thread *idle-thread*)
                (%lock-thread next)
                (setf (thread-state next) :active)
                (%%switch-to-thread *idle-thread* next))
               (t ;; Wait for an interrupt.
                (sys.int::%stihlt))))))
  
  (defun initialize-threads ()
    (when (not (boundp '*global-thread-lock*))
  