obviously broken code:

(defun get-circularity-hash ()
  "Get a clean hash for object serialization"
  (declare (type fixnum *circularity-initial-hash-size*))
  (if (= 0 (length *circularity-hash-queue*))
      (make-hash-table :test 'eq :size *circularity-initial-hash-size*)
      (ele-with-fast-lock (*serializer-fast-lock*)
        (vector-pop *circularity-hash-queue*))))

concurrent call could happen between check and pop, thus invalidating the 
check.

(defun get-cicularity-hash ()
   (or
      (ele-with-fast-lock (*serializer-fast-lock*)
        (and (plusp (length *circularity-hash-queue*))
             (vector-pop *circularity-hash-queue*)))
      (make-hash-table :test 'eq :size *circularity-initial-hash-size*)))




_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

Reply via email to