[elephant-cvs] CVS elephant/src/elephant

ieslick ieslick at common-lisp.net
Sat Feb 3 00:57:34 UTC 2007


Update of /project/elephant/cvsroot/elephant/src/elephant
In directory clnet:/tmp/cvs-serv12026/src/elephant

Modified Files:
	package.lisp serializer2.lisp 
Removed Files:
	cross-platform.lisp 
Log Message:
Fixed bug from last checkin; implemented abstraction for fast-locks for systems that have such a thing (such as without-interrupts in non-parallel lisps)

--- /project/elephant/cvsroot/elephant/src/elephant/package.lisp	2007/02/02 23:51:58	1.9
+++ /project/elephant/cvsroot/elephant/src/elephant/package.lisp	2007/02/03 00:57:34	1.10
@@ -20,7 +20,7 @@
 (in-package :cl-user)
 
 (defpackage elephant
-  (:use common-lisp elephant-memutil)
+  (:use :common-lisp :elephant-memutil :elephant-utils)
   (:nicknames ele :ele)
   (:documentation 
    "Elephant: an object-oriented database for Common Lisp with
@@ -93,9 +93,6 @@
 	   #:drop-instances
 
 	   ;; Utilities
-	   #:ele-make-lock
-	   #:ele-with-lock
-	   #:ele-without-interrupts
 	   #:slots-and-values
 	   )
   #+cmu  
--- /project/elephant/cvsroot/elephant/src/elephant/serializer2.lisp	2007/02/02 23:51:58	1.10
+++ /project/elephant/cvsroot/elephant/src/elephant/serializer2.lisp	2007/02/03 00:57:34	1.11
@@ -17,7 +17,7 @@
 (in-package :elephant)
 
 (defpackage :elephant-serializer2
-  (:use :cl :elephant :elephant-memutil)
+  (:use :cl :elephant :elephant-memutil :elephant-utils)
   (:import-from :elephant 
 		*circularity-initial-hash-size*
 		#+(or cmu sbcl allegro)
@@ -97,12 +97,14 @@
 (defparameter *circularity-hash-queue* (make-array 20 :fill-pointer 0 :adjustable t)
   "Circularity ids for the serializer.")
 
+(defvar *serializer-fast-lock* (ele-make-fast-lock))
+
 (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-without-interrupts 
+      (ele-with-fast-lock (*serializer-fast-lock*)
 	(vector-pop *circularity-hash-queue*))))
 
 (defun release-circularity-hash (hash)
@@ -110,7 +112,7 @@
   (declare (type hash-table hash))
   (unless (= (hash-table-count hash) 0)
     (clrhash hash))
-  (ele-without-interrupts 
+  (ele-with-fast-lock (*serializer-fast-lock*)
     (vector-push-extend hash *circularity-hash-queue*)))
 
 ;;
@@ -129,14 +131,14 @@
   (if (= 0 (length *circularity-vector-queue*))
       (make-array 50 :element-type t :initial-element nil 
 		  :fill-pointer 0 :adjustable t)
-      (ele-without-interrupts 
+      (ele-with-fast-lock (*serializer-fast-lock*)
 	(vector-pop *circularity-vector-queue*))))
 
 (defun release-circularity-vector (vector)
   "Don't need to erase, just reset fill-pointer as it 
    determines extent of valid data"
   (setf (fill-pointer vector) 0)
-  (ele-without-interrupts
+  (ele-with-fast-lock (*serializer-fast-lock*)
     (vector-push-extend vector *circularity-vector-queue* 20)))
 
 ;;




More information about the Elephant-cvs mailing list