1
0
Fork 0

- [RPC] bubbled-up error when using wait results cuncurrent events.

This commit is contained in:
cage 2023-03-11 12:42:46 +01:00
parent 162c6b8e63
commit 74b32349f6
1 changed files with 14 additions and 4 deletions

View File

@ -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))))
;;;;