From 419015957181dc30c9780c7f537fcc03eabc7e6d Mon Sep 17 00:00:00 2001 From: Vitaly Mayatskikh Date: Fri, 25 Sep 2009 20:25:24 +0200 Subject: [PATCH] Use mutexes from bordeaux-threads, not sb-thread --- cluster.lisp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cluster.lisp b/cluster.lisp index d161e40..26bb034 100644 --- a/cluster.lisp +++ b/cluster.lisp @@ -37,7 +37,7 @@ (input :initform nil :accessor node-input) (output :initform nil :accessor node-output) (sexp :initform nil :accessor node-sexp) - (lock :initform (make-mutex) :accessor node-lock))) + (lock :initform (bt:make-lock "node lock") :accessor node-lock))) (defmethod print-object ((object node) stream) (format stream "#N" (node-host object) (node-lisp object))) @@ -53,7 +53,7 @@ (:documentation "Establish connection with remote host.")) (defmethod node-connect ((object node)) - (with-mutex ((node-lock object)) + (bt:with-lock-held ((node-lock object)) (with-slots (host lisp process input output) object (when (not (sb-ext:process-p process)) (when (= 0 (system *ping* (format nil "-c 1 -w 1 ~a" host))) @@ -88,7 +88,7 @@ (:documentation "Send command to remote host (thread-safe).")) (defmethod node-send ((object node) msg) - (with-mutex ((node-lock object)) + (bt:with-lock-held ((node-lock object)) (node-send/unsafe object msg))) (defgeneric node-recv/unsafe (object &optional non-blocking) @@ -111,7 +111,7 @@ If optional argument `non-blocking' is set, don't wait for data.")) (defmethod node-recv ((object node) &optional non-blocking) - (with-mutex ((node-lock object)) + (bt:with-lock-held ((node-lock object)) (node-recv/unsafe object non-blocking))) (defgeneric node-flush/unsafe (object &optional wait-input) @@ -133,7 +133,7 @@ Wait for input when optional argument `wait-input' is set. This is useful to skip interactive prompt.")) (defmethod node-flush ((object node) &optional wait-input) - (with-mutex ((node-lock object)) + (bt:with-lock-held ((node-lock object)) (node-flush/unsafe object wait-input))) (defgeneric node-exec (object cmd &optional trap-errors) @@ -141,7 +141,7 @@ This is useful to skip interactive prompt.")) (defmethod node-exec ((object node) cmd &optional (trap-errors t)) (declare (type string cmd)) - (with-mutex ((node-lock object)) + (bt:with-lock-held ((node-lock object)) (node-flush/unsafe object) (setf (node-sexp object) cmd) (when trap-errors -- 2.11.4.GIT