From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: =?utf-8?B?0JPQtdC+0YDQs9C40Lkg0JrQuNGA0LjRh9C10L3QutC+?= Subject: Re: [tarantool-patches] [PATCH v4 2/9] core: latch_steal routine Date: Thu, 20 Jun 2019 23:34:22 +0300 Message-ID: <1885834.ODRnM29Kq8@home.lan> In-Reply-To: <20190620115311.ste2aez4rmqbmfln@esperanza> References: <20190620115311.ste2aez4rmqbmfln@esperanza> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3430682.TknHhPvp8z"; micalg="pgp-sha256"; protocol="application/pgp-signature" To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: --nextPart3430682.TknHhPvp8z Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 --nextPart3430682.TknHhPvp8z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEFB+nbqWGnp59Rk9ZFSyY70x8X3sFAl0L7c4ACgkQFSyY70x8 X3vJigf8Cwss+sXcZIu7fACp0OTOiR1A4HjrEHOjLWH1PILEhROu81OFXzJkuzQF xjcxeqnsZIoeEh1uidOvNV/MUbanmeOdYXWFC9/un+CP1nzUbU88vp906qpf2ZxM uj40RGGpKYebrSOHTm720sgkg2RSg7zkBS2erQ3lTMGYIHe3DzakCQw2bu010n2Q KyJStQ0+BUy0sGiY/nL9Lol7LaPuMC1/TdxIntT6OHP0mwvaFOYu+6pA9j+lWhkw yBUNwuLjw3W42TvE7NRwt8/GhyUScJUYLK9pGPdsuJpdmGs/sJwotybD3GUZ7W31 4AMRKftSWt8kqG/nDKHglzDQPD5uyg== =sYYy -----END PGP SIGNATURE----- --nextPart3430682.TknHhPvp8z--