summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-17 18:10:35 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-17 18:10:35 +0100
commit596b11b9c540d09e6138d09ee69624fe2b97e6b5 (patch)
tree6bd93cdcf75addebd807618096ae16dccff5ead7 /Lisp
parent0667c31269d99a7bec708559d84845a69b32dec3 (diff)
Synchronise access to *LISP-MANAGED-INSTANCES*.
darcs-hash:b2125c11d3e465a389dce6c91432790a706c579b
Diffstat (limited to 'Lisp')
-rw-r--r--Lisp/instance-management.lisp20
1 files changed, 11 insertions, 9 deletions
diff --git a/Lisp/instance-management.lisp b/Lisp/instance-management.lisp
index 371e78f..1e2fa1a 100644
--- a/Lisp/instance-management.lisp
+++ b/Lisp/instance-management.lisp
@@ -22,14 +22,16 @@
(defun intern-lisp-managed-foreign-instance (&rest initargs &key pointer)
(let ((key (cffi:pointer-address pointer)))
- (or (gethash key *lisp-managed-instances* nil)
- (setf (gethash key *lisp-managed-instances*)
- (apply #'make-instance
- (intern-pointer-wrapper
- 'class
- :pointer (%objcl-object-get-class pointer))
- initargs)))))
+ (with-exclusive-access (*lisp-managed-instances*)
+ (or (gethash key *lisp-managed-instances* nil)
+ (setf (gethash key *lisp-managed-instances*)
+ (apply #'make-instance
+ (intern-pointer-wrapper
+ 'class
+ :pointer (%objcl-object-get-class pointer))
+ initargs))))))
(defun unintern-lisp-managed-foreign-instance (instance)
- (remhash (cffi:pointer-address (pointer-to instance))
- *lisp-managed-instances*))
+ (with-exclusive-access (*lisp-managed-instances*)
+ (remhash (cffi:pointer-address (pointer-to instance))
+ *lisp-managed-instances*)))