Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

*** empty log message ***

  • Loading branch information...
commit a2debb3c835e2736bacea9a8ace9002ee8606e54 1 parent 92d6085
Helmut Eller authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 swank-lispworks.lisp
View
21 swank-lispworks.lisp
@@ -296,6 +296,7 @@ Return NIL if the symbol is unbound."
(etypecase dspec
(cons (ecase (car dspec)
(defun `(:function-name ,(symbol-name (cadr dspec))))
+ (method `(:function-name ,(symbol-name (cadr dspec))))
;; XXX this isn't quite right
(lw:top-level-form `(:source-path ,(cdr dspec) nil))))
(symbol `(:function-name ,(symbol-name dspec)))))
@@ -414,3 +415,23 @@ Return NIL if the symbol is unbound."
(defimplementation call-with-lock-held (lock function)
(mp:with-lock (lock) (funcall function)))
+(defimplementation current-thread ()
+ mp:*current-process*)
+
+(defimplementation interrupt-thread (thread fn)
+ (mp:process-interrupt thread fn))
+
+(defvar *mailbox-lock* (mp:make-lock))
+
+(defun mailbox (thread)
+ (mp:with-lock (*mailbox-lock*)
+ (or (getf (mp:process-plist thread) 'mailbox)
+ (setf (getf (mp:process-plist thread) 'mailbox)
+ (mp:make-mailbox)))))
+
+(defimplementation receive ()
+ (mp:mailbox-read (mailbox mp:*current-process*)))
+
+(defimplementation send (thread object)
+ (mp:mailbox-send (mailbox thread) object))
+
Please sign in to comment.
Something went wrong with that request. Please try again.