branch: elpa/slime
commit 62f4a5bd11480229f1aceb6bf810a995da511a0b
Author: Stas Boukarev <[email protected]>
Commit: Stas Boukarev <[email protected]>

    Don't lock packages.
    
    Doesn't actually help anything.
---
 contrib/swank-repl.lisp |  2 +-
 packages.lisp           |  3 +--
 swank-loader.lisp       |  6 +-----
 swank.asd               |  4 ++--
 swank.lisp              | 22 ++++++++++------------
 swank/backend.lisp      | 17 -----------------
 swank/sbcl.lisp         |  9 ---------
 7 files changed, 15 insertions(+), 48 deletions(-)

diff --git a/contrib/swank-repl.lisp b/contrib/swank-repl.lisp
index 4f531fdcab..51049865eb 100644
--- a/contrib/swank-repl.lisp
+++ b/contrib/swank-repl.lisp
@@ -359,7 +359,7 @@ dynamic binding."
 (defun prefixed-var (prefix variable-symbol)
   "(PREFIXED-VAR \"FOO\" '*BAR*) => SWANK::*FOO-BAR*"
   (let ((basename (subseq (symbol-name variable-symbol) 1)))
-    (intern (format nil "*~A-~A" (string prefix) basename) :swank-repl)))
+    (intern (format nil "*~A-~A" (string prefix) basename) :swank)))
 
 (defvar *standard-output-streams*
   '(*standard-output* *error-output* *trace-output*)
diff --git a/packages.lisp b/packages.lisp
index 175b01f288..0ffdb6fa64 100644
--- a/packages.lisp
+++ b/packages.lisp
@@ -66,8 +66,7 @@
            #:with-lock
            #:*slime-interrupts-enabled*
            #:with-slime-interrupts
-           #:without-slime-interrupts
-           #:with-unlocked-packages))
+           #:without-slime-interrupts))
 
 (swank-loader:define-package #:swank/rpc
   (:use #:cl)
diff --git a/swank-loader.lisp b/swank-loader.lisp
index b83c1776f6..2d085d42c7 100644
--- a/swank-loader.lisp
+++ b/swank-loader.lisp
@@ -314,11 +314,7 @@ If LOAD is true, load the fasl file."
   (when (#-clisp probe-file
          #+clisp ext:probe-directory
          (contrib-dir *source-directory*))
-    (eval `(pushnew (lambda ()
-                      (,(q "swank/backend:with-unlocked-packages") 
-                       (swank swank/backend)
-                       (compile-contribs)))
-                    ,(q "swank::*after-init-hook*"))))
+    (eval `(pushnew 'compile-contribs ,(q "swank::*after-init-hook*"))))
   (funcall (q "swank::init")))
 
 (defun list-swank-packages ()
diff --git a/swank.asd b/swank.asd
index f441597f3c..ff916eb07c 100644
--- a/swank.asd
+++ b/swank.asd
@@ -28,9 +28,9 @@
                  (uiop:symbol-call :swank-loader :slime-version-string)
                  (list
                   (uiop:symbol-call :swank-loader :contrib-dir
-                     (symbol-value (find-symbol "*FASL-DIRECTORY*" 
'swank-loader)))
+                     (symbol-value (intern "*FASL-DIRECTORY*" 'swank-loader)))
                   (uiop:symbol-call :swank-loader :contrib-dir
-                     (symbol-value (find-symbol "*SOURCE-DIRECTORY*" 
'swank-loader))))))
+                     (symbol-value (intern "*SOURCE-DIRECTORY*" 
'swank-loader))))))
   :components ((:file "swank-loader")
                (:file "packages")
                (:file "xref" :if-feature :clisp)
diff --git a/swank.lisp b/swank.lisp
index a00fd210a2..476d84f4e8 100644
--- a/swank.lisp
+++ b/swank.lisp
@@ -2543,15 +2543,14 @@ Record compiler notes signalled as 
`compiler-condition's."
 
 (defslimefun swank-require (modules &optional filename)
   "Load the module MODULE."
-  (with-unlocked-packages (swank/backend)
-    (dolist (module (ensure-list modules))
-      (unless (member (string module) *modules* :test #'string=)
-        (catch 'dont-load
-          (require module (if filename
-                              (filename-to-pathname filename)
-                              (module-filename module)))
-          (assert (member (string module) *modules* :test #'string=)
-                  () "Required module ~s was not provided" module)))))
+  (dolist (module (ensure-list modules))
+    (unless (member (string module) *modules* :test #'string=)
+      (catch 'dont-load
+        (require module (if filename
+                            (filename-to-pathname filename)
+                            (module-filename module)))
+        (assert (member (string module) *modules* :test #'string=)
+                () "Required module ~s was not provided" module))))
   *modules*)
 
 (defvar *find-module* 'find-module
@@ -3899,9 +3898,8 @@ Collisions are caused because package information is 
ignored."
 (defun before-init (version load-path)
   (pushnew :swank *features*)
   (setq *swank-wire-protocol-version* version)
-  (setq *load-path* load-path)
-  (loop for x in '(swank/backend swank/rpc swank/match swank-mop swank/gray)
-        do (lock-package x)))
+  (setq *load-path* load-path))
+
 
 (defun init ()
   (run-hook *after-init-hook*))
diff --git a/swank/backend.lisp b/swank/backend.lisp
index 3148938d1b..21bb3fde60 100644
--- a/swank/backend.lisp
+++ b/swank/backend.lisp
@@ -1642,20 +1642,3 @@ Implementations intercept calls to SPEC and call, in 
this order:
   "Handle interrupts"
   (declare (ignore interrupt-handler))
   (funcall function))
-
-(definterface lock-package (package)
-  "Lock PACKAGE"
-  (declare (ignore package)))
-
-(definterface unlock-package (package)
-  "Unlock PACKAGE"
-  (declare (ignore package)))
-
-(definterface expand-with-unlocked-packages (packages body)
-  "Lock PACKAGE"
-  (declare (ignore packages))
-  `(progn ,@body))
-
-(defmacro with-unlocked-packages ((&rest packages) &body body)
-  (expand-with-unlocked-packages packages body))
-
diff --git a/swank/sbcl.lisp b/swank/sbcl.lisp
index 2004460103..1450c94f31 100644
--- a/swank/sbcl.lisp
+++ b/swank/sbcl.lisp
@@ -2042,12 +2042,3 @@ stack."
 (defimplementation call-with-interrupt-handler (interrupt-handler function)
   (let ((sb-thread:*interrupt-handler* interrupt-handler))
     (funcall function)))
-
-(defimplementation lock-package (package)
-  (sb-ext:lock-package package))
-
-(defimplementation unlock-package (package)
-  (sb-ext:unlock-package package))
-
-(defimplementation expand-with-unlocked-packages (packages body)
-  `(sb-ext:with-unlocked-packages ,packages ,@body))

Reply via email to