anchor.diff:  
   ;;; Multi-threading support
   
  -#+sbcl
  +#+sb-thread
   (progn
     (defvar *global-lock* (sb-thread:make-mutex :name "global GDK lock"))
  -  (let ((recursive-level 0))
  -    (defun threads-enter ()
  -      (if (eq (sb-thread:mutex-value *global-lock*) sb-thread:*current-thread*)
  -	  (incf recursive-level)
  - 	(sb-thread:get-mutex *global-lock*)))
  -
  -    (defun threads-leave (&optional flush-p)
  -      (cond
  -       ((zerop recursive-level)	  
  -	(when flush-p
  -	  (display-flush))
  -	(sb-thread:release-mutex *global-lock*))
  -       (t (decf recursive-level)))))
  +
  +  (defun %global-lock-p ()
  +    (eq (car (sb-thread:mutex-value *global-lock*)) sb-thread:*current-thread*))
  +
  +  (defun threads-enter ()
  +    (if (%global-lock-p)
  +	(incf (cdr (sb-thread:mutex-value *global-lock*)))
  +      (sb-thread:get-mutex *global-lock* (cons sb-thread:*current-thread* 0))))
  +    
  +  (defun threads-leave (&optional flush-p)
  +    (assert (%global-lock-p))
  +    (cond
  +     ((zerop (cdr (sb-thread:mutex-value *global-lock*)))
  +      (when flush-p
  +	(flush))
  +      (sb-thread:release-mutex *global-lock*))
  +     (t (decf (cdr (sb-thread:mutex-value *global-lock*))))))
   
     (define-callback %enter-fn nil ()
       (threads-enter))
  
positive.code: ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  
  ;; $Id: gdk.lisp,v 1.38 2007-06-01 09:17:17 espen Exp $
  
  
  (in-package "GDK")
  
negative.code:   (display display))
  
  (defun find-display (name)
    (if (not name)
        (display-get-default)
      (find name (list-displays) :key #'display-name :test #'string=)))
  
  (defun ensure-display (display)
    (etypecase display
      (null (display-get-default))
      (display display)
      (string (or (find-display display) (display-open display)))))
  
  
  ;;; Display manager
  