emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ssh-deploy b8468ec 004/133: Added flag for using thread


From: Stefan Monnier
Subject: [elpa] externals/ssh-deploy b8468ec 004/133: Added flag for using threads or not
Date: Sat, 27 Mar 2021 14:48:32 -0400 (EDT)

branch: externals/ssh-deploy
commit b8468ece9232946cc54b708e194820d0086b940c
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Added flag for using threads or not
---
 ssh-deploy.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ssh-deploy.el b/ssh-deploy.el
index 74dc8bd..afbf72a 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -207,6 +207,12 @@
 (put 'ssh-deploy-async 'permanent-local t)
 (put 'ssh-deploy-async 'safe-local-variable 'booleanp)
 
+(defcustom ssh-deploy-async-with-threads nil
+  "Boolean variable if asynchronous method should use threads if available, 
nil by default."
+  :type 'boolean)
+(put 'ssh-deploy-async-with-threads 'permanent-local t)
+(put 'ssh-deploy-async-with-threads 'safe-local-variable 'booleanp)
+
 (defcustom ssh-deploy-revision-folder "~/.ssh-deploy-revisions/"
   "String variable with file name to revisions with trailing slash."
   :type 'string)
@@ -302,9 +308,11 @@
 ;; these functions MUST not use module variables in any way.
 
 
+;; TODO This should not rely on global variable
 (defun ssh-deploy--async-process (start &optional finish)
   "Asynchronously do START and then optionally do FINISH."
-  (if (fboundp 'make-thread)
+  (if (and (fboundp 'make-thread)
+           ssh-deploy-async-with-threads)
       (make-thread (lambda()
                      (if start
                          (let ((result (funcall start)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]