mirror of https://codeberg.org/cage/tinmop/
- [RPC] bubbled-up error when using wait results cuncurrent events.
This commit is contained in:
parent
162c6b8e63
commit
74b32349f6
|
@ -244,9 +244,15 @@
|
|||
(condition-variable condition-variable)
|
||||
(callback payload)
|
||||
(results results)) object
|
||||
(setf (box:unbox results) (funcall callback))
|
||||
(with-lock (lock)
|
||||
(bt:condition-notify condition-variable))))
|
||||
(handler-case
|
||||
(progn
|
||||
(setf (box:unbox results) (funcall callback))
|
||||
(with-lock (lock)
|
||||
(bt:condition-notify condition-variable)))
|
||||
(error (e)
|
||||
(setf (box:unbox results) e)
|
||||
(with-lock (lock)
|
||||
(bt:condition-notify condition-variable))))))
|
||||
|
||||
(defun push-function-and-wait-results (fn &key
|
||||
(priority +standard-event-priority+)
|
||||
|
@ -262,7 +268,11 @@
|
|||
while (null (box:unbox (results event)))
|
||||
do
|
||||
(bt:condition-wait condition-variable lock)))
|
||||
(box:unbox (results event))))
|
||||
(let* ((event-results (results event))
|
||||
(actual-results (box:unbox event-results)))
|
||||
(if (typep actual-results 'error)
|
||||
(error actual-results)
|
||||
actual-results))))
|
||||
|
||||
;;;;
|
||||
|
||||
|
|
Loading…
Reference in New Issue