[Tarantool-patches] [PATCH 5/6] txn: stop using txn_has_flag

Cyrill Gorcunov gorcunov at gmail.com
Thu Feb 4 01:02:24 MSK 2021


On Wed, Feb 03, 2021 at 08:47:39PM +0100, Vladislav Shpilevoy wrote:
> > 
> > The initial rationale for this series was (as far as I remember) to
> > setup several flags at once, so I think you could consider implementing
> > txn_set_flags() helper which would do the trick instead. Thus lets drop
> > this series, it doesn't make anything better without using neg operator.
> 
> Another purpose of the issue was to make TXN_WAIT_SYNC a part of
> TXN_WAIT_ACK. Because ACK is never present without SYNC.
> 
> Talking of the setting many flags at once - you still can do this,
> even with txn_set_flag(). Just rename txn_set_flag() to txn_set_flags(),
> and make the flags proper bitfields like in the first commits of this
> series. Then we could do
> 
> 	txn_set_flags(TXN_WAIT_SYNC | TXN_WAIT_ACK)
> 
> Although I don't know what to do with checking flags. If we add
> txn_has_flags(), then should it return true if all the requested
> flags are present, or if any of them?

I think we can stick with txn_has_flags to exact match and txn_has_flagsa
for any flag.


More information about the Tarantool-patches mailing list