anchor.diff:      ;; Default timeslice is 10ms/0.01s.
       ;; Work at read-time to avoid floats at runtime.
       (setf *timeslice-length* #.(truncate (* 0.01 internal-time-units-per-second)))
  -    (setf *world-stop-lock* (make-mutex "World stop lock")
  -          *world-stop-cvar* (make-condition-variable "World stop cvar")
  -          *world-stop-pending* nil
  -          *pseudo-atomic-thread-count* 0)
  +    (setf *pseudo-atomic-thread-count* 0
  +          *pending-world-stoppers* (make-wait-queue :name '*pending-world-stoppers*)
  +          *pending-pseudo-atomics* (make-wait-queue :name '*pending-pseudo-atomics*))
       (setf *all-threads* sys.int::*snapshot-thread*
             (thread-global-next sys.int::*snapshot-thread*) sys.int::*pager-thread*
             (thread-global-prev sys.int::*snapshot-thread*) nil
  
positive.code:   ;; Don't let the pager run until the paging disk has been found.
    (reset-ephemeral-thread sys.int::*pager-thread* #'pager-thread :sleeping :supervisor)
    (setf (thread-wait-item sys.int::*pager-thread*) "Waiting for paging disk")
    (reset-ephemeral-thread sys.int::*disk-io-thread* #'disk-thread :runnable :supervisor)
    (condition-notify *world-stop-cvar* t))
  
  (defun wake-thread (thread)
    "Wake a sleeping thread."
  
negative.code:       (panic "Stopping world while pseudo-atomic!"))
      (ensure-interrupts-enabled)
      (inhibit-thread-pool-blocking-hijack
       (%call-on-wired-stack-without-interrupts #'%stop-the-world nil)
       (unwind-protect
            (progn
              (quiesce-cpus-for-world-stop)
              (funcall thunk))
         (%call-on-wired-stack-without-interrupts #'%resume-the-world nil)
         (broadcast-wakeup-ipi)))))
  
  (defmacro with-world-stopped (&body body)
    `(call-with-world-stopped (dx-lambda () ,@body)))
  