On Thursday, June 20, 2019 2:53:11 PM MSK Vladimir Davydov wrote: > On Thu, Jun 20, 2019 at 12:23:09AM +0300, Georgy Kirichenko wrote: > > Allow to steal locked latch ownership for fiber which isn't owner > > of the latch. This is required to process transaction triggers > > asynchronously. > > > > Prerequisites: #1254 > > --- > > > > src/lib/core/latch.h | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/src/lib/core/latch.h b/src/lib/core/latch.h > > index 49c59cf63..580942564 100644 > > --- a/src/lib/core/latch.h > > +++ b/src/lib/core/latch.h > > @@ -155,6 +155,16 @@ latch_trylock(struct latch *l) > > > > return latch_lock_timeout(l, 0); > > > > } > > > > +/** > > + * Take a latch ownership > > + */ > > +static inline void > > +latch_steal(struct latch *l) > > +{ > > + assert(l->owner != NULL); > > + l->owner = fiber(); > > +} > > + > > Please try not to introduce dead code. This patch should be squashed > into the one that actually uses latch_steal IMO. Ack