Changeset 3145
- Timestamp:
- 05/21/08 16:40:27 (6 months ago)
- Files:
-
- branches/bos/bknr/src/data/object.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/bos/bknr/src/data/object.lisp
r2373 r3145 579 579 (destroy-object obj))))) 580 580 581 ;;; In order to avoid concurrency problems, we lock creation of 582 ;;; objects early. Otherwise, we may run into the situation that an 583 ;;; object id is used for two objects. 584 585 (defvar *make-object-lock* (mp-make-lock)) 586 581 587 (defun make-object (class-name &rest initargs) 582 588 "Make a persistent object of class named CLASS-NAME. Calls MAKE-INSTANCE with INITARGS." 583 (execute (make-instance 'transaction 584 :function-symbol 'tx-make-object 585 :args (append (list class-name 586 :id (id-counter (store-object-subsystem))) 587 initargs)))) 589 (mp-with-recursive-lock-held (*make-object-lock*) 590 (execute (make-instance 'transaction 591 :function-symbol 'tx-make-object 592 :args (append (list class-name 593 :id (next-object-id (store-object-subsystem))) 594 initargs))))) 588 595 589 596 (defun tx-delete-object (id)
