Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYUcR-00Bkd3-NR for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jul 2024 17:57:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYUcQ-001sNp-7y for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jul 2024 17:57:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYUcP-001sNh-Ud for pgsql-hackers@lists.postgresql.org; Mon, 29 Jul 2024 17:57:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYUcN-0026mR-NF for pgsql-hackers@postgresql.org; Mon, 29 Jul 2024 17:57:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46THv28s2812471; Mon, 29 Jul 2024 13:57:02 -0400 From: Tom Lane To: Andres Freund cc: Heikki Linnakangas , pgsql-hackers@postgresql.org Subject: Re: Detect double-release of spinlock In-reply-to: <20240729174853.uo5qjqkxlacjg6vv@awork3.anarazel.de> References: <2600757.1722267116@sss.pgh.pa.us> <20240729161846.kgiafbe2dtgabxgb@awork3.anarazel.de> <2802449.1722270793@sss.pgh.pa.us> <20240729164026.yurg37tej34o76uk@awork3.anarazel.de> <20240729165154.56zqyg34x2ywkpsh@awork3.anarazel.de> <2809049.1722273922@sss.pgh.pa.us> <20240729174853.uo5qjqkxlacjg6vv@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 29 Jul 2024 10:48:53 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2812469.1722275822.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 29 Jul 2024 13:57:02 -0400 Message-ID: <2812470.1722275822@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > However, I still don't think it's a problem to assert that the lock is h= eld in > in the unlock "routine". As mentioned before, the spinlock implementatio= n > itself has never followed the "just straight line code" rule that users = of > spinlocks are supposed to follow. Yeah, that's fair. regards, tom lane