Changeset 2611
- Timestamp:
- 02/24/08 00:54:44 (11 months ago)
- Files:
-
- trunk/bknr/datastore/src/data/txn.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bknr/datastore/src/data/txn.lisp
r2610 r2611 138 138 (merge-pathnames #P"random-state" (store-current-directory store))) 139 139 140 (defun initialize-store-random-state (store) 141 (with-open-file (f (store-random-state-pathname store) 142 :direction :output :if-does-not-exist :create :if-exists :supersede) 143 (format t "initializing store random state~%") 144 (with-standard-io-syntax 145 (prin1 (setf (store-random-state store) (make-random-state t)) f)))) 146 140 147 (defmethod ensure-store-random-state ((store store)) 141 148 (if (probe-file (store-random-state-pathname store)) 142 149 (with-open-file (f (store-random-state-pathname store)) 143 (setf (store-random-state store) (read f))) 144 (with-open-file (f (store-random-state-pathname store) 145 :direction :output :if-does-not-exist :create :if-exists :supersede) 146 (format t "initializing store random state~%") 147 (with-standard-io-syntax 148 (prin1 (setf (store-random-state store) (make-random-state t)) f))))) 150 (restart-case 151 (setf (store-random-state store) 152 (handler-case 153 (read f) 154 (error (e) (error "Invalid store random state")))) 155 (initialize-store-random-state () 156 :report "Initialize the random state of the store" 157 (initialize-store-random-state store)) 158 (ignore-store-random-state () 159 :report "Ignore the on-disk random state of the store)" 160 (setf (store-random-state store) (make-random-state t))))) 161 (initialize-store-random-state store))) 149 162 150 163 (defmethod update-store-random-state ((store store))
