Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipUqW-0003bJ-5o for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jan 2020 10:15:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ipUqU-0007Wt-Fc for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jan 2020 10:15:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipUqU-0007Wm-6d for pgsql-hackers@lists.postgresql.org; Thu, 09 Jan 2020 10:15:18 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ipUqP-0007kL-JM for pgsql-hackers@postgresql.org; Thu, 09 Jan 2020 10:15:17 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 14F2F79A; Thu, 9 Jan 2020 05:15:11 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 09 Jan 2020 05:15:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=zZwTIJxOJLWadtsm4YI4XcuRtB8Y07cLUnkIZXl6T Lk=; b=dnECVsLTM06gcCot/1xoIEP41USPY5bInWkbYngdE3yubfR9flTyceFkL JVmuMVSCd3xAxWSpLAXCsHVqGAe6q7vwXpzMjdK4VS/XNN6a2Zzew0T6mE4zVqhi OEIIvevGYULJLpPQhyKHJ8UTCWowbrD79jxuV3VPWkDBtxAlpWvdGuRfxZIE4zQU 79qvXBoHbygv9OHgFTIvk045FlNYnAgbpcpu96pQDKugga+RABu4Wjz/ePjJJ71E 4zWfEtxysS+Iegi2BlDRp8ak9Lq+NPy+twMtVLJ9rIUgmJgTn8P4KqfZlRY5DPMY Tn7g6wTCWpKqF0G40NrhJDF4VCuIg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeitddgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtjeertddtfeehnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuffhomhgrihhnpedvnhguqhhurggurhgrnhhtrdgt ohhmnecukfhppeelfedrvdegfedrudekjedrudeggeenucfrrghrrghmpehmrghilhhfrh homhepphgvthgvrhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhm necuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from april.pezone.net (p5df3bb90.dip0.t-ipconnect.de [93.243.187.144]) by mail.messagingengine.com (Postfix) with ESMTPA id E134080066; Thu, 9 Jan 2020 05:15:09 -0500 (EST) Subject: Re: remove some STATUS_* symbols To: Michael Paquier References: <20200106063159.GQ3598@paquier.xyz> Cc: pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Thu, 9 Jan 2020 11:15:08 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200106063159.GQ3598@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-01-06 07:31, Michael Paquier wrote: > On Sun, Dec 29, 2019 at 11:33:34AM +0100, Peter Eisentraut wrote: >> Attached are two patches to remove these two symbols. STATUS_FOUND can be >> replaced by a simple bool. STATUS_WAITING is replaced by a separate enum. > > Patch 0001 looks good to me, but I got to wonder why the check after > waitMask in LockAcquireExtended() is not done directly in > LockCheckConflicts(). You mean put he subsequent GrantLock() calls into LockCheckConflicts()? That would technically save some duplicate code, but it seems weird, because LockCheckConflicts() is notionally a read-only function that shouldn't change state. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services