From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4176442EF5C for ; Sun, 21 Jun 2020 18:53:06 +0300 (MSK) References: <16c9d1ffb9d09bb2b2f206a23973e2734616c345.1592482315.git.sergepetrenko@tarantool.org> <4229c1b6-54e1-3c84-c902-37d49d3658c6@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Sun, 21 Jun 2020 17:53:04 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org >>> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c >>> index a715a136e..c55f5bda1 100644 >>> --- a/src/box/txn_limbo.c >>> +++ b/src/box/txn_limbo.c >>> @@ -84,6 +84,16 @@ txn_limbo_remove(struct txn_limbo *limbo, struct txn_limbo_entry *entry) >>>       rlist_del_entry(entry, in_queue); >>>   } >>>   +static inline void >>> +txn_limbo_pop(struct txn_limbo *limbo, struct txn_limbo_entry *entry) >>> +{ >>> +    assert(!rlist_empty(&entry->in_queue)); >>> +    assert(rlist_last_entry(&limbo->queue, struct txn_limbo_entry, >>> +                 in_queue) == entry); >>> +    (void) limbo; >>> +    rlist_del_entry(entry, in_queue); >>> +} >> txn_limbo_remove is exactly the same as txn_limbo_pop. I suggest to keep >> one of them. >> >> Everything else looks nice. > > Assertions are different. I wanted to stress  that `pop` removes entries starting > > from the tail, and `remove`, on the contrary,  removes them starting from the > > head. I didn't notice the assertions are different. In that case it is fine.