On Tue, 2018-07-17 at 15:22 -0700, Francisco Jerez wrote: > Jan Vesely <jan.ves...@rutgers.edu> writes: > > > On Tue, 2018-07-17 at 14:17 -0700, Francisco Jerez wrote: > > > Jan Vesely <jan.ves...@rutgers.edu> writes: > > > > > > > Abort all dependent events. > > > > Signed-off-by: Jan Vesely <jan.ves...@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. > > > > sure. It wasn't clear to me if it's ok to execute both action_ok and > > action_fail for the same event. My understanding was that exactly one > > of them is called. > > > > I can even do: > > void > > -event::trigger() { > > +event::trigger() try { > > if (wait_count() == 1) > > action_ok(*this); > > > > for (event &ev : trigger_self()) > > ev.trigger(); > > +} catch (error &e) { > > + abort(e.get()) > > } > > Yeah, that should work too.
thanks. I pushed both and added cc stable tag. Jan > > > > > > > Jan > > > > > > > > Thanks. > > > > > > > for (event &ev : trigger_self()) > > > > ev.trigger(); > > > > -- > > > > 2.16.4 > > > > -- > > Jan Vesely <jan.ves...@rutgers.edu> > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev -- Jan Vesely <jan.ves...@rutgers.edu>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev