Revision: 3659 Author: hans URL: http://bknr.net/trac/changeset/3659
Make locks non-recursive - Recursive locks are not needed for the kind of application, and it helps cmucl which does not seem to have recursive locks.
U trunk/thirdparty/hunchentoot/lispworks.lisp U trunk/thirdparty/hunchentoot/session.lisp U trunk/thirdparty/hunchentoot/util.lisp
Modified: trunk/thirdparty/hunchentoot/lispworks.lisp =================================================================== --- trunk/thirdparty/hunchentoot/lispworks.lisp 2008-07-28 14:07:28 UTC (rev 3658) +++ trunk/thirdparty/hunchentoot/lispworks.lisp 2008-07-28 14:18:12 UTC (rev 3659) @@ -97,14 +97,6 @@ "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." (mp:make-lock :name name))
-(defun make-recursive-lock (name) - "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." - (mp:make-lock :name name)) - -(defmacro with-recursive-lock-held ((lock) &body body) - "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." - `(mp:with-lock (,lock) ,@body)) - (defmacro with-lock-held ((lock) &body body) "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." `(mp:with-lock (,lock) ,@body))
Modified: trunk/thirdparty/hunchentoot/session.lisp =================================================================== --- trunk/thirdparty/hunchentoot/session.lisp 2008-07-28 14:07:28 UTC (rev 3658) +++ trunk/thirdparty/hunchentoot/session.lisp 2008-07-28 14:18:12 UTC (rev 3659) @@ -29,7 +29,7 @@
(in-package :hunchentoot)
-(defvar *session-data-lock* (make-recursive-lock "session-data-lock") +(defvar *session-data-lock* (make-lock "session-data-lock") "A lock to prevent two threads from modifying *SESSION-DATA* at the same time.")
@@ -123,7 +123,7 @@ (defun session-gc () "Removes sessions from *session-data* which are too old - see SESSION-TOO-OLD-P." - (with-recursive-lock-held (*session-data-lock*) + (with-lock-held (*session-data-lock*) (setq *session-data* (loop for id-session-pair in *session-data* for (nil . session) = id-session-pair @@ -148,7 +148,7 @@ there's no session for the current request." (with-rebinding (symbol) (with-unique-names (place %session) - `(with-recursive-lock-held (*session-data-lock*) + `(with-lock-held (*session-data-lock*) (let* ((,%session (or ,session (start-session))) (,place (assoc ,symbol (session-data ,%session) :test #'eq))) (cond @@ -189,7 +189,7 @@ (return-from start-session session)) (setf session (make-instance 'session) (session *request*) session) - (with-recursive-lock-held (*session-data-lock*) + (with-lock-held (*session-data-lock*) (setq *session-data* (acons (session-id session) session *session-data*))) (set-cookie *session-cookie-name* :value (session-cookie-value session) @@ -199,7 +199,7 @@ (defun remove-session (session) "Completely removes the SESSION object SESSION from Hunchentoot's internal session database." - (with-recursive-lock-held (*session-data-lock*) + (with-lock-held (*session-data-lock*) (funcall *session-removal-hook* session) (setq *session-data* (delete (session-id session) *session-data* @@ -279,7 +279,7 @@ (defun reset-sessions () "Removes ALL stored sessions and creates a new session secret." (reset-session-secret) - (with-recursive-lock-held (*session-data-lock*) + (with-lock-held (*session-data-lock*) (loop for (nil . session) in *session-data* do (funcall *session-removal-hook* session)) (setq *session-data* nil))
Modified: trunk/thirdparty/hunchentoot/util.lisp =================================================================== --- trunk/thirdparty/hunchentoot/util.lisp 2008-07-28 14:07:28 UTC (rev 3658) +++ trunk/thirdparty/hunchentoot/util.lisp 2008-07-28 14:18:12 UTC (rev 3659) @@ -370,16 +370,6 @@ (bt:make-lock name))
#-:lispworks -(defun make-recursive-lock (name) - "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." - (bt:make-recursive-lock name)) - -#-:lispworks -(defmacro with-recursive-lock-held ((lock) &body body) - "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." - `(bt:with-recursive-lock-held (,lock) ,@body)) - -#-:lispworks (defmacro with-lock-held ((lock) &body body) "Simple wrapper to allow LispWorks and Bordeaux Threads to coexist." `(bt:with-lock-held (,lock) ,@body)) \ No newline at end of file