anchor.diff:      ;; If we did not have a main-thread channel, make a default main
       ;; thread.
       #-(and ccl darwin)
  -    (bt:make-thread #'sdl-main-thread :name "SDL2 Main Thread")
  +    (setf *the-main-thread* (bt:make-thread #'sdl-main-thread :name "SDL2 Main Thread"))
   
       ;; On OSX, we need to run in the main thread; CCL allows us to
       ;; safely do this.  On other platforms (mainly GLX?), we just need
       ;; to run in a dedicated thread.
       #+(and ccl darwin)
       (let ((thread (find 0 (ccl:all-processes) :key #'ccl:process-serial-number)))
  +      (setf *the-main-thread* thread)
         (ccl:process-interrupt thread #'sdl-main-thread)))
     (in-main-thread (:no-event t)
       ;; HACK! glutInit on OSX uses some magic undocumented API to
  
positive.code: 
  (defun quit ()
    "Shuts down SDL2."
    (in-main-thread (:no-event t)
      (sdl-quit)
      (setf *main-thread-channel* nil)
      (setf *lisp-message-event* nil)))
  
  (defmacro with-init ((&rest sdl-init-flags) &body body)
    `(progn
  
negative.code:            (error 'sdl-rc-error :rc ,wrapper :string (sdl-get-error))
             ,wrapper))))
  
  (defvar *the-main-thread* nil)
  (defvar *main-thread-channel* nil)
  (defvar *main-thread* nil)
  (defvar *lisp-message-event* nil)
  