[Mesa-dev] [PATCH 1/2] clover: Catch errors from executing event action
Francisco Jerez
currojerez at riseup.net
Tue Jul 17 21:17:25 UTC 2018
Jan Vesely <jan.vesely at rutgers.edu> writes:
> Abort all dependent events.
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
> src/gallium/state_trackers/clover/core/event.cpp | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/event.cpp b/src/gallium/state_trackers/clover/core/event.cpp
> index cd5d786604..ed2b6ebdb8 100644
> --- a/src/gallium/state_trackers/clover/core/event.cpp
> +++ b/src/gallium/state_trackers/clover/core/event.cpp
> @@ -51,7 +51,12 @@ event::trigger_self() {
> void
> event::trigger() {
> if (wait_count() == 1)
> - action_ok(*this);
> + try {
> + action_ok(*this);
> + } catch (error &e) {
> + for (event &ev : abort_self(e.get()))
> + ev.abort(e.get());
> + }
>
Any reason not to do it like:
| try {
| if (wait_count() == 1)
| action_ok(*this);
| } catch (error &e) {
| abort(e.get());
| }
That seems slightly simpler and it should make sure that the abort
action of the failing event is executed as well.
Thanks.
> for (event &ev : trigger_self())
> ev.trigger();
> --
> 2.16.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180717/899779d8/attachment.sig>
More information about the mesa-dev
mailing list