r9199: fold clsql-base and clsql-base-sys into clsql-base
[clsql.git] / base / pool.lisp
index 53730e3a462a87a267fd4faf99f4b107042f63eb..0564eb0e33f9651c2bc9af616e6c815d99111677 100644 (file)
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
-(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 (,lock) ,@body)
-      #+openmcl (ccl:with-lock-grabbed (,lock) ,@body)
-      #+lispworks (mp:with-lock (,l) ,@body)
-      #+sb-thread (sb-thread:with-recursive-lock (,lock) ,@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))
+(in-package #:clsql-base)
 
 (defvar *db-pool* (make-hash-table :test #'equal))
 (defvar *db-pool-lock* (make-process-lock "DB Pool lock"))