1.0.7.7: slightly less broken handling of obsolete structures
[sbcl.git] / src / pcl / boot.lisp
index c8f9912..526229f 100644 (file)
@@ -2090,10 +2090,15 @@ bootstrapping.
   (let ((new-state (if (and dfun (or cache info))
                        (list* dfun cache info)
                        dfun)))
-    (if (eq *boot-state* 'complete)
-        (setf (safe-gf-dfun-state gf) new-state)
-        (setf (clos-slots-ref (get-slots gf) *sgf-dfun-state-index*)
-              new-state)))
+    (cond
+      ((eq *boot-state* 'complete)
+       ;; Check that we are under the lock.
+       #+sb-thread
+       (aver (eq sb-thread:*current-thread* (sb-thread::spinlock-value (gf-lock gf))))
+       (setf (safe-gf-dfun-state gf) new-state))
+      (t
+       (setf (clos-slots-ref (get-slots gf) *sgf-dfun-state-index*)
+             new-state))))
   dfun)
 
 (defun gf-dfun-cache (gf)