X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=base%2Fpool.lisp;h=bebe1b649430756dc99192604a404a98821ca42f;hp=e051423dced247c09b3cae05e5f46cbfe65d4738;hb=f68abc76e0e01f4633141a0c17a4d8f1976229b8;hpb=6d9165359a584853a2a230e1a2e27823a31841fb diff --git a/base/pool.lisp b/base/pool.lisp index e051423..bebe1b6 100644 --- a/base/pool.lisp +++ b/base/pool.lisp @@ -18,34 +18,6 @@ (in-package #:clsql-base-sys) -(defun make-process-lock (name) - #+allegro (mp:make-process-lock :name name) - #+cmu (mp:make-lock name) - #+lispworks (mp:make-lock :name name) - #+openmcl (ccl:make-lock :name name) - #+sb-thread (sb-thread:make-mutex :name name) - #+scl (thread:make-lock name) - #-(or allegro cmu lispworks openmcl sb-thread scl) (declare (ignore name)) - #-(or allegro cmu lispworks openmcl sb-thread scl) nil) - -(defmacro with-process-lock ((lock desc) &body body) - #+(or cmu allegro lispworks openmcl sb-thread) - (declare (ignore desc)) - #+(or allegro cmu lispworks openmcl sb-thread) - (let ((l (gensym))) - `(let ((,l ,lock)) - #+allegro (mp:with-process-lock (,l) ,@body) - #+cmu (mp:with-lock-held (,l) ,@body) - #+openmcl (ccl:with-lock-grabbed (,l) ,@body) - #+lispworks (mp:with-lock (,l) ,@body) - #+sb-thread (sb-thread:with-recursive-lock (,l) ,@body) - )) - - #+scl `(thread:with-lock-held (,lock ,desc) ,@body) - - #-(or cmu allegro lispworks openmcl sb-thread scl) (declare (ignore lock desc)) - #-(or cmu allegro lispworks openmcl sb-thread scl) `(progn ,@body)) - (defvar *db-pool* (make-hash-table :test #'equal)) (defvar *db-pool-lock* (make-process-lock "DB Pool lock"))