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 1iqAyZ-00019J-57 for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2020 07:14:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iqAyX-0006ZW-Ul for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2020 07:14:25 +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 1iqAyX-0006ZP-Ma for pgsql-hackers@lists.postgresql.org; Sat, 11 Jan 2020 07:14:25 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iqAyU-0007rY-Q1 for pgsql-hackers@postgresql.org; Sat, 11 Jan 2020 07:14:25 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id EE37837D; Sat, 11 Jan 2020 02:14:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 11 Jan 2020 02:14:20 -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=tcBpLtqtQ3VAXu7Qtcw4Xuf+S+910vNz8GGj2gaib Ss=; b=CtvUziwbAxcGzAOFgKUsnj1hkW26xIEkZsWYVI4VPO3Vd8b6jNXbZ3weq 114Vqik4Yw3aVlaKGY4tAB9g03iDssOHZAbM4cz0JVxh/9CieDUzcix2LLSgPCNe Qpe3XCW9BjMvgqYgZYuwFvjsLypyo/Z5Onw0P3KIeqgOztfwelHhGAvPDbhqMaVA o3c2SpnC09+T0u81XTncvtAVWq5HDfKaWmYMiEoaZp+O+fyu5Iz98AZN/8syrvcr NU0jsSqw+MjaAs6caNygKjiMtW+jqPXVLDVO38fM9Xm0c1S4xa8rx83iRUM1fwpR 3fT7KOU8C68nUrr6OJkeEVBjC41TQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeigedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefheenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnh guqhhurggurhgrnhhtrdgtohhmqeenucffohhmrghinhepvdhnughquhgrughrrghnthdr tghomhenucfkphepleefrddvgeefrdduieefrddvvdejnecurfgrrhgrmhepmhgrihhlfh hrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnughquhgrughrrghnthdrtgho mhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from april.pezone.net (p5df3a3e3.dip0.t-ipconnect.de [93.243.163.227]) by mail.messagingengine.com (Postfix) with ESMTPA id 80FE280059; Sat, 11 Jan 2020 02:14:18 -0500 (EST) Subject: Re: remove some STATUS_* symbols To: Michael Paquier References: <20200106063159.GQ3598@paquier.xyz> <20200110052332.GI1702@paquier.xyz> Cc: pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <4edc8a92-373c-1a4d-eded-6b342f0890dc@2ndquadrant.com> Date: Sat, 11 Jan 2020 08:14:17 +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: <20200110052332.GI1702@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-10 06:23, Michael Paquier wrote: > On Thu, Jan 09, 2020 at 11:15:08AM +0100, Peter Eisentraut wrote: >> 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. > > Nah. I was thinking about the first part of this "if" clause > LockCheckConflicts is part of here: > if (lockMethodTable->conflictTab[lockmode] & lock->waitMask) > status = STATUS_FOUND; > else > status = LockCheckConflicts(lockMethodTable, lockmode, > lock, proclock); > > But now that I look at it closely it messes up heavily with > ProcSleep() ;) OK, pushed as it was then. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services