[bknr-cvs] hans changed trunk/thirdparty/hunchentoot/session.lisp

BKNR Commits bknr at bknr.net
Thu Jul 31 15:57:09 UTC 2008


Revision: 3710
Author: hans
URL: http://bknr.net/trac/changeset/3710

Start session outside of lock scope in order to avoid recursive
locking.

U   trunk/thirdparty/hunchentoot/session.lisp

Modified: trunk/thirdparty/hunchentoot/session.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/session.lisp	2008-07-31 12:00:25 UTC (rev 3709)
+++ trunk/thirdparty/hunchentoot/session.lisp	2008-07-31 15:57:09 UTC (rev 3710)
@@ -148,16 +148,16 @@
 there's no session for the current request."
   (with-rebinding (symbol)
     (with-unique-names (place %session)
-      `(with-lock-held (*session-data-lock*)
-         (let* ((,%session (or ,session (start-session)))
-                (,place (assoc ,symbol (session-data ,%session) :test #'eq)))
-           (cond
-             (,place
-              (setf (cdr ,place) ,new-value))
-             (t
-              (push (cons ,symbol ,new-value)
-                    (slot-value ,%session 'session-data))
-              ,new-value)))))))
+      `(let ((,%session (or ,session (start-session))))
+         (with-lock-held (*session-data-lock*)
+           (let* ((,place (assoc ,symbol (session-data ,%session) :test #'eq)))
+             (cond
+               (,place
+                (setf (cdr ,place) ,new-value))
+               (t
+                (push (cons ,symbol ,new-value)
+                      (slot-value ,%session 'session-data))
+                ,new-value))))))))
 
 (defun delete-session-value (symbol &optional (session *session*))
   "Removes the value associated with SYMBOL from the current session




More information about the Bknr-cvs mailing list