Plaster
New
List
Login
text
default
anonymous
2020.06.25 06:17:42
# HG changeset patch # User Mark <evenson.not.org@gmail.com> # Date 1591433318 -7200 # Sat Jun 06 10:48:38 2020 +0200 # Node ID 6fd5dd55d070fbf5ddc6ecb389c9535218a39095 # Parent 6747ec085780a0da0a6d65f719db593d144d251c INCOMPLETE working through lock problems on ABCL diff -r 6747ec085780 -r 6fd5dd55d070 dependent.lisp --- a/dependent.lisp Sun May 10 11:41:04 2020 +0200 +++ b/dependent.lisp Sat Jun 06 10:48:38 2020 +0200 @@ -553,6 +553,12 @@ (defun make-process-lock (name) (mp:make-recursive-mutex name)) +#+abcl +(defun make-process-lock (name) + (threads:make-mutex + :name name "Anonymous lock" + :lock (jnew "java.util.concurrent.locks.ReentrantLock"))) + ;;; HOLDING-LOCK: Execute a body of code with a lock held. ;;; The holding-lock macro takes a timeout keyword argument. EVENT-LISTEN @@ -622,6 +628,13 @@ `(:timeout ,timeout))) ,@body)) +#+(or) ;; How to implement a timeout? +(defmacro holding-lock ((lock display &optional (whostate "CLX wait") + &key timeout) + &body body) + (declare (ignore display whostate)) + (threads:with-thread-lock (lock))) + ;;; WITHOUT-ABORTS ;;; If you can inhibit asynchronous keyboard aborts inside the body of this
Raw
Annotate
Repaste
Edit