From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3C193431780 for ; Sat, 15 Aug 2020 19:27:03 +0300 (MSK) Received: by mail-lf1-f67.google.com with SMTP id c15so6318346lfi.3 for ; Sat, 15 Aug 2020 09:27:03 -0700 (PDT) Date: Sat, 15 Aug 2020 19:27:00 +0300 From: Cyrill Gorcunov Message-ID: <20200815162700.GG2074@grain> References: <20200814211442.667099-1-gorcunov@gmail.com> <20200814211442.667099-6-gorcunov@gmail.com> <0da9d013-6b94-fc4d-17d4-379dcf51bbed@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0da9d013-6b94-fc4d-17d4-379dcf51bbed@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v7 5/8] applier: factor out latch locking List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tml On Sat, Aug 15, 2020 at 05:04:32PM +0200, Vladislav Shpilevoy wrote: > > +static inline struct latch * > > +applier_lock(uint32_t replica_id) > > +{ > > + struct replica *replica = replica_by_id(replica_id); > > + struct latch *latch = (replica ? &replica->order_latch : > > We usually use != NULL to check if a pointer is not NULL. To emphasize > it is not a boolean variable in the code. I simply copied this code from old place. But sure, will add.